Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eminetto/api-o11y
Repository used in a talk about APIs and Observability
https://github.com/eminetto/api-o11y
Last synced: 4 days ago
JSON representation
Repository used in a talk about APIs and Observability
- Host: GitHub
- URL: https://github.com/eminetto/api-o11y
- Owner: eminetto
- Created: 2023-04-04T19:06:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-22T14:13:13.000Z (about 1 year ago)
- Last Synced: 2024-08-01T13:28:57.317Z (3 months ago)
- Language: Go
- Size: 12.8 MB
- Stars: 67
- Watchers: 4
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ccamel - eminetto/api-o11y - Repository used in a talk about APIs and Observability (Go)
README
# API Observability
### Building
```
docker compose up -d --build
```## Using the services
### Auth
```
curl -X "POST" "http://localhost:8081/v1/auth" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d $'{
"email": "[email protected]",
"password": "12345"
}'```
The result should be a token, like:
```
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4"
}
```### Feedback
You need to use the token generated by the ```Auth``` service:
```
curl -X "POST" "http://localhost:8082/v1/feedback" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4' \
-d $'{
"title": "Feedback test",
"body": "Feedback body"
}'
```### Vote
You need to use the token generated by the ```Auth``` service:
```
curl -X "POST" "http://localhost:8083/v1/vote" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGVtYWlsLmNvbSIsImV4cCI6MTY4MTM0ODQ3MSwiaWF0IjoxNjgxMzQ0ODQxLCJuYmYiOjE2ODEzNDQ4NDF9.GdUiLYqrXeUZNIgHDhGDhGIV1NpN941UiFBqgvSoS-4' \
-d $'{
"talk_name": "Go e Microserviços",
"score": "10"
}'
```