Skip to content

Fast API + rqlite with authentication. Just a test.

Notifications You must be signed in to change notification settings

wvoliveira/fasrq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fasrq

Example API with framework FastAPI and database Rqlite with authentication

Tested

  • Python 3.7.3
  • Pip 18.1
  • Docker 19.03

Developing

Local dependencies

Before run application, we need run the rqlite database with auth.

make run_database

Create virtualenv, install dependencies and run:

make

Or just run with: make run_api

With docker

# run database
make run_database

# in another terminal build and run API
make run

Access to localhost:8000/docs and be happy.

Make GET/PUT/POST/DELETE methods in /docs endpoint.

To clean database and cache, execute: make clean

Routes

  • GET localhost:8000/: Get all items.
  • GET localhost:8000/[id]: Get single item.
  • PUT localhost:8000/: Insert task.
  • POST localhost:8000/: Insert/update task.
  • DELETE localhost:8000/[id]: Delete single item.