mazufik / notes-restful-api

Home Page:https://notes-restful-api.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Installation

git clone https://github.com/mazufik/notes-restful-api.git

cd notes-restful-api

npm run start

API Spec

Create Notes

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"
}

Get Note

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"
}

Update Note

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"
}

Delete Note

Request:

  • Method : DELETE
  • Endpoint : /api/notes/{id}
  • Header :
    • Accept : application/json

Response:

{
  "code": "number",
  "status": "string",
  "message": "string"
}

About

https://notes-restful-api.vercel.app


Languages

Language:JavaScript 100.0%