The flask app is running by default on port 8000. Here we assume that the app is running on localhost.
GET
Say hello to the world.
http://localhost:8000/
POST
Register a new user.
http://localhost:8000/register
{
"username": "username",
"password": "password"
}
- 200: User register failed:
{ "message": "User register failed", "status": false }
- 200: User register success:
{ "message": "User registered successfully", "status": true, "token": "eyJhbGciOiJIUI1NiIsIn5cCI6IkpXVCJ9.ey1c2VyIjocGhpbEiLCJpZCIM30.v_lKLd0X-PABkRFXHZa..." }
GET,POST
Login as user
http://localhost:8000/login
{
"username": "username",
"password": "password"
}
- 200: User login failed:
{ "message": "Wrong Password", "status": false }
- 200: User login success:
{ "message": "Log in successfully", "status": true, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1..." }