- GOlang-API-C
- Go needs to be installed.
- Some tool to endpoint testing (curl, postman)
git clone https://augustoscher@bitbucket.org/augustoscher/api-c.git
cd go-api-c
go get
or one by one
got get github.com/codegangsta/negroni
got get github.com/dgrijalva/jwt-go
got get github.com/gorilla/context
got get github.com/gorilla/mux
got get github.com/mitchellh/mapstructure
go run main.go
{
"username": "augusto",
"password": "testing"
}
It should return:
{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6InRlc3RpbmciLCJ1c2VybmFtZSI6ImF1Z3VzdG8ifQ.77xiMA_tBkEhwigv9n5iAk_i59Y63eRLWuk3AehARO8"}
You have to add Bearer Token in header of every request.
GET http://localhost:3000/consultascpf/02206795012
or
http://localhost:3000/consultascpf
GET http://localhost:3000/movimentosfinanceiro/02506196013
or
GET http://localhost:3000/movimentosfinanceiro
GET http://localhost:3000/movimentoscartao/02506196013
or
A url http://localhost:3000/movimentoscartao
Dockerize the API and HTTP Rest Client with docker-compose