Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.01 KB

todo-app.rest

File metadata and controls

55 lines (37 loc) · 1.01 KB

### Get '/' website

GET http://localhost:8383

### Register a user POST auth/register

POST http://localhost:8383/auth/register Content-Type: application/json

{
"username": "[email protected]", "password": "123456"

}

### Login a user POST auth/login

POST http://localhost:8383/auth/login Content-Type: application/json

{
"username": "[email protected]", "password": "123456"

}

### Fetch all todos Get /todos (protected)

GET http://localhost:8383/todos/ Authorization: your_jwt_secret_key

### create a new Todo POST /todos (protected)

POST http://localhost:8383/todos/ Authorization: your_jwt_secret_key Content-Type: application/json

{
"task": "bro do the gym"

}

### update a Todo PUT /todos/:ID (protected)

PUT http://localhost:8383/todos/2 Authorization: your_jwt_secret_key Content-Type: application/json

{
"task": "bro THIS IS CHANGED TODO", "completed": 1

}

### delte a Todo delete /todos/:ID (protected)

DELETE http://localhost:8383/todos/2 Authorization: your_jwt_secret_key