- Download Node Js to your system and install
- Clone this repository
- Go to the project directory on your Command Line and run the command npm install
- Download MySQL database to your system and install
- Create database chijiblog in your MySQL database
- Start application by running the command node index
- Test application with the following URL http://localhost:8000
All requests header must contain Content-Type: application/json
- GET - /blog -> To get all available blog posts
- GET- /blog?page=2 -> To get available blog posts with pagination
- POST - /post -> To create new blog post
body :{
"category_id" : "1",
"title" : "femi is a boy not a girl",
"content" : "ade is a girl",
"keywords" : "ade is a girl",
"published" : "1"
} - PUT - /post/:id -> To update a particular blog post
body :{
"category_id" : "1",
"title" : "femi is a boy not a girl",
"content" : "ade is a girl",
"keywords" : "ade is a girl",
"published" : "1"
}
- GET- /post/:id -> To get a specific blog post
- DELETE - /post/:id -> To delete a specific blog post
- POST - /post/:post_id/comment -> To create new comment on blog post
body :{
"name" : "oderinwale femi",
"message" : "This is a new post"
}
- PUT - /post/:post_id/comment/:id -> To update a particular comment on blog post
body :{
"name" : "oderinwale femi",
"message" : "This is a new post"
}
- GET- /post/:post_id/comments -> To get all comments on blog post
- DELETE - /post/:post_id/comment/:id -> To delete a specific comment on blog post
body :{
"category_id" : "1",
"title" : "femi is a boy not a girl",
"content" : "ade is a girl",
"keywords" : "ade is a girl",
"published" : "1"
}
body :{
"category_id" : "1",
"title" : "femi is a boy not a girl",
"content" : "ade is a girl",
"keywords" : "ade is a girl",
"published" : "1"
}
body :{
"name" : "oderinwale femi",
"message" : "This is a new post"
}
body :{
"name" : "oderinwale femi",
"message" : "This is a new post"
}