Skip to content

eminetto/talk-microservices-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

talk-microservices-go

Using the services

Auth

curl -X "POST" "http://localhost:8081/v1/auth" \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -d $'{
  "email": "eminetto@gmail.com",
  "password": "1234567"
}'

The result should be a token, like:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVtaW5ldHRvQGdtYWlsLmNvbSIsImV4cCI6MTU2ODkwNTM3MCwiaWF0IjoxNTY4OTAxNzQwLCJuYmYiOjE1Njg5MDE3NDB9.07my1r33iKhfUuR3XK87YomK00Fcio_Ve7ZXlaq0Jb0"
}

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.eyJlbWFpbCI6ImVtaW5ldHRvQGdtYWlsLmNvbSIsImV4cCI6MTU2ODkwNTM3MCwiaWF0IjoxNTY4OTAxNzQwLCJuYmYiOjE1Njg5MDE3NDB9.07my1r33iKhfUuR3XK87YomK00Fcio_Ve7ZXlaq0Jb0' \
     -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.eyJlbWFpbCI6ImVtaW5ldHRvQGdtYWlsLmNvbSIsImV4cCI6MTU2ODkwNTM3MCwiaWF0IjoxNTY4OTAxNzQwLCJuYmYiOjE1Njg5MDE3NDB9.07my1r33iKhfUuR3XK87YomK00Fcio_Ve7ZXlaq0Jb0' \
     -d $'{
  "talk_name": "Go e Microserviços",
  "score": "10"
}'

About

Código da palestra sobre micro serviços e Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published