bff_api_gateway_example

Description

BFF と API ゲートウェイの連携部分のサンプル

Install

pip install -r requirements.txt

Command

curl -X POST -H "Content-Type: application/json" -d '{"username": "user1", "password": "password1"}' http://localhost:2000/bff/login
# {
#   "token": "Bearer 37d8e0684f9d11636765fa38280bbe8b"
# }

curl -X GET -H "Authorization: Bearer 37d8e0684f9d11636765fa38280bbe8b" http://localhost:2000/bff/resource
# {
#   "message": "This is the resource for user1"
# }

curl -X GET -H "Authorization: invalid_token" http://localhost:2000/bff/resource
# {
#   "message": "Unauthorized"
# }

curl -X GET -H "Authorization: Bearer invalid_token" http://localhost:2000/bff/resource
# {
#   "message": "Invalid token"
# }

Contribution

  1. Fork it ( https://github.com/zdogma/bff_api_gateway_example/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

zdogma