Skip to content

Latest commit

 

History

History
101 lines (74 loc) · 1.34 KB

ROUTES.md

File metadata and controls

101 lines (74 loc) · 1.34 KB

Routes wannadbBackend

The flask app is running by default on port 8000. Here we assume that the app is running on localhost.



HelloWorld

GET

Say hello to the world.

http://localhost:8000/

Register

POST

Register a new user.

http://localhost:8000/register

Body

{
    "username": "username",
    "password": "password"
}

Response

  • 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..."
    }

Login

GET,POST

Login as user

http://localhost:8000/login

Body

{
    "username": "username",
    "password": "password"
}

Response

  • 200: User login failed:
    {
        "message": "Wrong Password",
        "status": false
    }
  • 200: User login success:
    {
        "message": "Log in successfully",
        "status": true,
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1..."
    }