Skip to content

Latest commit

 

History

History
71 lines (64 loc) · 1.16 KB

readme.md

File metadata and controls

71 lines (64 loc) · 1.16 KB

NestJS Todo APP

just use git clone and npm run start:dev note: you must have mongodb, no jest or swagger for now.

endpoints:

auth

  1. POST /auth/register body:
{
  "email": "[email protected]",
  "password": "1234526789",
  "username": "myname"
}
  1. POST /auth/login body:
{
  "email": "[email protected]",
  "password": "1234526789"
}

response:

{
  "access_token": "JWT_ACCESS_TOKEN"
}

(must use this header when needed: authorization: JWT_ACCESS_TOKEN)
3. GET /auth/profile (need authorization)

tasks

all tasks endpoints need an authorization:

  1. POST /tasks create a task for a user
    body:
{
  "title": "",
  "description": "",
  "status": 0
}

status:

Pending = 0
SUCCESS = 1
CANCELED = 2
IN_PROGRESS = 3

  1. GET /tasks, list tasks
    Query:
"?page=2&include_deleted=true"
  1. GET /tasks/:id get task id
  2. PUT /tasks/:id edit tasks status:
// one or more is required
{
  "title": "",
  "description": "",
  "status": 2,
  "isDeleted": true
}
  1. Delete /tasks/:id delete a task, short for PUT /tasks/:id with isDeleted: true.