Skip to content

Repository used in a talk about APIs and Observability

Notifications You must be signed in to change notification settings

eminetto/api-o11y

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}'

About

Repository used in a talk about APIs and Observability

Resources

Stars

Watchers

Forks

Packages

No packages published