Client
===================
1. npm install
2. npm run dev
Server
===================
1. npm install
2. please get your keyfile.json from google to enable upload image to google cloud storage
3. insert your env variables, see the template
4. npm run dev
Link : http://deeppress.cado.store/
Route : /login
Method : POST
Headers : -
Body :
{
"email" : "[email protected]",
"password" : "johnDoe123"
}
Response :
Success :
{
"status": 200,
"token": <TOKEN>
}
Error :
{
"status": 400,
"message": "Invalid Email/Password"
}
Route : /register
Method : POST
Headers : -
Body :
{
"username" : "johnDoe",
"email" : "[email protected]",
"password" : "johnDoe123"
}
Response :
Success :
{
"status": 201,
"message": "User Registered",
"createdUser"
}
Error :
{
"status": 401,
"message": "User already registered"
}
All of routes below need token! [ Authentication ]
Headers : TOKEN
Route : /articles
Method : POST
Body :
{
title : STRING,
content : STRING,
tags : [],
file : <IMAGE TYPE FILE>
}
Response :
Success :
{
status : 200,
createdArticle
}
Route : /articles
Method : GET
Body : -
Response :
Success :
{
status : 200,
articles : []
}
Route : /articles/:id
Method : GET
Body : -
Response :
Success :
{
status : 200,
article
}
Route : /articles/user
Method : GET
Body : -
Response :
Success :
{
status : 200,
articles
}
Route : /articles/user
Method : GET
Body : -
Query :
{
title
}
Response :
Success :
{
status : 200,
articles
}
Route : /articles/tag
Method : POST
Body :
{
tags : []
}
Response :
Success :
{
status : 200,
articles : []
}
Route : /articles/user/search
Method : GET
Query :
{
title
}
Body : -
Response :
Success :
{
status : 200,
articles : []
}
Will Authorized , You need to be the owner of the article to user this feature
Route : /articles/:id
Method : PUT
Body :
title : STRING,
content : STRING,
tags : [],
file : <IMAGE FILE TYPE>
Response :
Success :
{
status : 200,
message,
updatedCount
}
Route : /articles/:id
Method : DELETE
Body : -
Response :
Success :
{
status : 200,
message,
deletedCount
}