From f0a6aca9e23034653e6bea0d408c52e511dd3680 Mon Sep 17 00:00:00 2001 From: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:06:32 +0100 Subject: [PATCH] Cross origin request handling for REST server in nwaku (#175) --- docs/guides/nwaku/config-options.md | 1 + docs/guides/nwaku/run-docker-compose.md | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/nwaku/config-options.md b/docs/guides/nwaku/config-options.md index 56f2d39..293c4b6 100644 --- a/docs/guides/nwaku/config-options.md +++ b/docs/guides/nwaku/config-options.md @@ -119,6 +119,7 @@ Here are the available node configuration options, along with their default valu | `rest-relay-cache-capacity` | `30` | Capacity of the Relay REST API message cache | | `rest-admin` | `false` | Enable access to REST HTTP Admin API: true\|false | | `rest-private` | `false` | Enable access to REST HTTP Private API: true\|false | +| `rest-allow-origin` | | Allow cross-origin requests from the specified origin. When using the REST API in a browser, specify the origin host to get a valid response from the node REST HTTP server. This option may be repeated and can contain wildcards (?,\*) for defining URLs and ports such as `localhost:*`, `127.0.0.1:8080`, or allow any website with `*` | ## Metrics config diff --git a/docs/guides/nwaku/run-docker-compose.md b/docs/guides/nwaku/run-docker-compose.md index c8e242d..ddf8ccc 100644 --- a/docs/guides/nwaku/run-docker-compose.md +++ b/docs/guides/nwaku/run-docker-compose.md @@ -96,8 +96,7 @@ curl --location 'http://127.0.0.1:8645/relay/v1/auto/messages' \ --header 'Content-Type: application/json' \ --data '{ "payload": "'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'", - "contentTopic": "/my-app/2/chatroom-1/proto", - "timestamp":'$(date +%s)' + "contentTopic": "/my-app/2/chatroom-1/proto" }' ``` @@ -110,4 +109,4 @@ curl --location 'http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app :::tip Congratulations! You have successfully started a `nwaku` node with `RLN` enabled using Docker Compose. Have a look at the [Node Configuration Examples](/guides/nwaku/configure-nwaku) and [Advanced Configuration](https://github.com/waku-org/nwaku-compose/blob/master/ADVANCED.md) guides to learn how to configure `nwaku` for different use cases. -::: \ No newline at end of file +:::