git clone https://github.com/mazufik/notes-restful-api.git
cd notes-restful-api
npm run start
Request:
- Method : POST
- Endpoint :
/api/notes
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{
"title": "string",
"tags": "array of string",
"body": "string"
}
Response body success:
{
"code": "number",
"status": "string",
"message": "string",
"data": {
"id": "string",
"title": "string",
"createdAt": "string",
"updatedAt": "string",
"tags": "array of string",
"body": "string"
}
}
Response body error:
{
"code": "number",
"status": "string",
"message": "string"
}
Request:
- Method : Get
- Endpoint :
/api/notes/{id}
- Header :
- Accept : application/json
Response:
{
"code": "number",
"status": "string",
"message": "string",
"data": {
"id": "string",
"title": "string",
"createdAt": "string",
"updatedAt": "string",
"tags": "array of string",
"body": "string"
}
}
Response error:
{
"code": "number",
"status": "string",
"message": "string"
}
Request:
- Method : PUT,
- Endpoint :
/api/notes/{id}
- Header :
- Content-Type : application/json
- Accept : application/json
- Body :
{
"title": "string",
"tags": "array of string",
"body": "string"
}
Response body success:
{
"code": "number",
"status": "string",
"message": "string",
"data": {
"id": "string",
"title": "string",
"createdAt": "string",
"updatedAt": "string",
"tags": "array of string",
"body": "string"
}
}
Response body error:
{
"code": "number",
"status": "string",
"message": "string"
}
Request:
- Method : DELETE
- Endpoint :
/api/notes/{id}
- Header :
- Accept : application/json
Response:
{
"code": "number",
"status": "string",
"message": "string"
}