/microservices-with-fastapi

Microservices with FastAPI

Primary LanguagePython

Microservices with FastAPI

Running

Example requests

  • There are already created 2 users in users db
  • get api token with admin user
    curl --header "Content-Type: application/json" \
         --request POST \
         --data '{"username":"admin","password":"a"}' \
         http://localhost:8001/api/login
    
  • You'll see something similar to below
    {"access_token":"***","token_type":"bearer"}
    
  • use this token to make administrative level requests
    curl --header "Content-Type: application/json" \
         --header "Authorization: Bearer ***" \
         --request GET \
         http://localhost:8001/api/users
    
  • Similar trials can be also done with default user to create & view orders