Skip to content

KillerMax4299/to-do-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

GET Routes

  • Default route /

    Response

    "APi Connected"
  • /username/:input

    Returns the Username availability

    Example: /username/Myname

    Response

    if Myname is available response will be true else false

POST Routes

  • /register

    Request Body

    {
      "username": "your_username",
      "password": "your_password"
    }
  • /login

    Request Body

    {
      "username": "your_username",
      "password": "your_password"
    }

    Response

    if Credentials are correct

    "Bearer <JWT token>"

    each token created will be valid for 30 days.

    Else false

CRUD options

valid authorization token is required from /login response.

The route for CRUD operations is /json

Note:

/json?res=true

returns the data on every Mutations

  • Read Todo (GET)

    Only valid token will return the list           //as array of objects
    
  • Add Todo (POST)

    {
      "id": integer,
      "name": string
    }
  • Delete Todo (DELETE)

    {
      "id": integer,
      "name": string
    }
  • Update Todo (PATCH)

    {
      "index": integer,                // index of the element to update
      "id": integer,
      "name": string                   // new name of the element
    }