Model
{
"_id":ObjectId(),
"email":string,
"name":string,
"password":string,
"createdAt":DateTime
}
{
"_id":ObjectId(),
"author":string,
"authorId":ObjectId(),
"content":{
"title":string,
"content":string
},
"tags":Array(string),
"createdAt":Datetime,
"updatedAt":Datetime,
}
POST:
Request
{
"email":string,
"name":string,
"password":string,
}
Response
{
"message":"user registration success"
}
POST:
Request
{
"email"|"username":string,
"password":string
}
Response:
cookies
{
Authorization:token
}
GET:
Response
10 *
{
"_id":ObjectId(),
"author":string,
"authorId":ObjectId(),
"content":{
"title":string,
"content":string
},
"tags":Array(string),
"createdAt":Datetime,
"updatedAt":Datetime,
}
POST:
Request
{
"title":string,
"content":string
}
Response
{
"message":"Successfully created"
}
GET:
Response
[,
...
{
"_id":ObjectId(),
"author":"",
"authorId":ObjectId(),
"content":{
"title":"",
"content":""
},
"tags":[],
"createdAt":"",
"updatedAt":"",
},
...
]
POST:
Request
{
"author":"",
"authorId":ObjectId(),
"content":{
"title":"",
"content":""
},
"tags":[],
}
Response
{
"message":"Content was successfully created"
}
PUT:
Request
{
"author":"",
"authorId":ObjectId(),
"content":{
"title":"",
"content":""
},
"tags":[],
}
Response
{
"message":"Content was successfully updated"
}
DELETE:
Response
{
"message":"Content was successfully updated"
}