mhmmd-ysf / mini-wp-1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mini-wp

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
Success
200 OK
Fail
400 Bad Request
Sign a user in
/auth/google POST Headers
token: String
Success
200 OK
Fail
400 Bad Request
Sign a user in using Google account
/users GET none Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all users
/users/:id GET Headers
token: String
Success
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
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Update one user
/users/:id DELETE Headers
token: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Delete a user

Article Router:

Route Method Request(s) Response(s) Description
/articles POST Headers
token: String
Body
name: String
description: String
dueDate: Date
Success
201 Created
Fail
401 Authorization Error
500 Internal Server Error
Create an article
/articles GET Headers
token: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all articles
/articles/tag GET Headers
token: String
Query
tag: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all articles with given tag
/articles/myArticle GET Headers
token: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get all user's articles
/articles/:articleId GET Headers
token: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Get one article
/articles/:articleId PUT Headers
token: String
Body
name: String
description: String
dueDate: Date
status: Boolean
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Update one article
/articles/:articleId DELETE Headers
token: String
Success
200 OK
Fail
401 Authorization Error
500 Internal Server Error
Delete an article

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

About


Languages

Language:JavaScript 44.1%Language:CSS 28.5%Language:HTML 27.4%