1
0
mirror of synced 2025-02-21 20:18:23 +00:00
omahs e8310e3ea8
Fix typos (#503)
* fix typo

* fix typo

* fix typo

* fix typos

* fix typo
2023-11-03 09:29:40 +01:00

34 lines
867 B
Markdown

# Http service examples
## Axum.rs
A simple service to demonstrate how to register http handler for overwatch service.
To run this example use:
```bash
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:
```bash
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:
```bash
curl --location --request POST 'localhost:8080/dummygraphqlservice/' \
--data-raw '{"query":"query {val}","variables":{}}'
```
Every response should increment the `val` variable.
```json
{"data":{"val":1}}
```