nomos-node/nomos-services/http/examples
Al Liu 516eab8ba5
fix comments
2023-11-09 13:49:09 +08:00
..
README.md Fix typos (#503) 2023-11-03 09:29:40 +01:00
axum.rs update overwatch version 2023-11-08 16:38:22 +08:00
graphql.rs fix comments 2023-11-09 13:49:09 +08:00

README.md

Http service examples

Axum.rs

A simple service to demonstrate how to register http handler for overwatch service.

To run this example use:

cargo run --example axum --features http

A GET endpoint will be registered at http://localhost:8080/dummy/. An endpoint corresponds with the Service name.

Graphql.rs

A demonstration of usage from within an overwatch service over the http.

To run this example use:

cargo run --example graphql --features http,gql

An endpoint will be registered at http://localhost:8080/dummygraphqlservice/. An endpoint corresponds with the Service name.

To query this endpoint use:

curl --location --request POST 'localhost:8080/dummygraphqlservice/' \
--data-raw '{"query":"query {val}","variables":{}}'

Every response should increment the val variable.

{"data":{"val":1}}