A simple auth RESTful API built with Flask
Note that pipenv package was used to create virtual environment.
pipenv package can be installed using: pip install pipenv
.
-
Clone this repository
-
cd into flask-rest
-
Run
pipenv shell
-
Run
pip install -r requirements.txt
-
python run.py
- /register
-- This route requires JSON payload.
-- The payload contains user registration data
-- Methods allowed: POST
-- Sample JSON payload:
{ "name": "Test", "email": "test@example.com", "password": "secret" }
- /login
-- This route requires JSON payload.
-- The payload contains user login data
-- Methods allowed: POST
-- Sample JSON payload:
{ "email": "test@example.com", "password": "secret" }
-- JWT access token that expires in 30 minutes will be returned.
All protected routes can be accessed using the JWT by specifying x-access-token
in the request header.