/fancy-todo-1

Primary LanguageJavaScript

fancy-todo

Route Home

Route Method Request(s) Response(s) Description
/ GET none 200 OK Showing home in a JSON format

User Router:

Route Method Request(s) Response(s) Description
/register POST Body
name: String
email: String
password: String
Success
201 Created
Fail
500 Internal Server Error
Create a user
/login POST Body
email: String
password: String
200 OK
Fail
400 Bad Request
Sign a user in
/auth/google POST Headers
token: String
200 OK
Fail
400 Bad Request
Sign a user in using Google account
/users GET none 200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all users
/users/:id GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get one user
/users/:id PUT Headers
token: String
Body
name: String
email: String
password: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Update one user
/users/:id DELETE Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Delete a user

Todo Router:

Route Method Request(s) Response(s) Description
/todos POST Headers
token: String
Body
name: String
description: String
dueDate: Date
Success
201 Created
Fail
401 Authorization Error
500 Internal Server Error
Create a todo
/todos GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all todos
/todos/myTodo GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all user's todos
/todos/:todoId GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get one todo
/todos/:todoId PUT Headers
token: String
Body
name: String
description: String
dueDate: Date
status: Boolean
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Update one todo
/todos/:todoId DELETE Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Delete a todo

Project Router:

Route Method Request(s) Response(s) Description
/projects POST Headers
token: String
Body
name: String
user: String
Success
201 Created
Fail
401 Authorization Error
500 Internal Server Error
Create a project
/projects GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all projects
/projects/myProjects GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all user's projects
/projects/todos/:todoId PUT Headers
token: String
Body
name: String
description: String
status: Boolean
dueDate: String
Success
201 Created
Fail
401 Authorization Error
500 Internal Server Error
Update a Todo in specified project
/projects/todos/:todoId DELETE Headers
token: String
Success
200 Created
Fail
401 Authorization Error
500 Internal Server Error
Delete a Todo in specified project
/projects/todos/:projectId GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get one todo in a specified project
/projects/:projectId POST Headers
token: String
name: String
description: String
dueDate: String
201 OK
Fail
401 Authorization Error
500 Internal Server Error
Create a project in specified project
/projects/:projectId GET Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get one project
/projects/:projectId PUT Headers
token: String
Body
name: String
description: String
dueDate: Date
status: Boolean
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Update one project
/projects/:projectId DELETE Headers
token: String
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Delete a project

Error Handling (Undefined Routes):

Route Method Request(s) Response(s) Description
/* any any Fail
404 Not Found
Catch any unmatched routes and redirect them here