mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
* Rename waku_api to rest_api and underlying rest to endpoint for clearity * Rename node/api to node/kernel_api to suggest that it is an internal accessor to node interface + make everything compile after renaming * make waku api a top level import * fix use of relative path imports and use default to root rather in case of waku and tools modules
24 lines
551 B
Nim
24 lines
551 B
Nim
{.push raises: [].}
|
|
|
|
import
|
|
json,
|
|
std/sets,
|
|
stew/byteutils,
|
|
strformat,
|
|
chronicles,
|
|
json_serialization,
|
|
json_serialization/std/options,
|
|
presto/[route, client, common]
|
|
import ../../../waku_core, ../serdes, ../responses, ../rest_serdes, ./types
|
|
|
|
export types
|
|
|
|
proc encodeBytes*(value: PushRequest, contentType: string): RestResult[seq[byte]] =
|
|
return encodeBytesOf(value, contentType)
|
|
|
|
proc sendPushRequest*(
|
|
body: PushRequest
|
|
): RestResponse[PushResponse] {.
|
|
rest, endpoint: "/lightpush/v3/message", meth: HttpMethod.MethodPost
|
|
.}
|