An Api that provides CRUD for blog posts and commenting on corresponding posts
URL | HTTP Method | Description |
---|---|---|
/posts | POST | Create a new Post |
/posts | GET | Get all posts |
/posts | DELETE | Delete all posts |
/posts/:postId | GET | Get a single post with id = postId |
/posts/:postId | PATCH | Update a post with id = postId |
/posts/:postId | DELETE | Delete post with id = postId |
/posts/:postId/comments | POST | Add a comment on post with id = postId |
/posts/:postId/comments | GET | Get all comments under post with id = postId |
/posts/:postId/comments | DELETE | Delete all comments under post with id = postId |
/posts/:postId/comments/:commentId | GET | Get a single comment with id = postId |
/posts/:postId/comments/:commentId | PATCH | Update a single comment with id = postId |
/posts/:postId/comments/:commentId | DELETE | Delete a single comment with id = postId |
- Nodejs environment
- Text Editor Microsoft Visual studio code
- Github bash terminal
- Postman API development
-
Clone the repo. run command
git clone https://github.com/Mubangizi/blog-api.git
-
Navigate into the folder that is cloned. run command
cd blog-api
- Nodejs environment
- Postman API development
- MySql Server
- To install the required dependencies, run the command
npm install
- To start the app run the command
npm start
App will start on your local host - To start development environment, run
npm run dev
- Once the app is running got to browser enter
<hostUrl:port>/api-docs
endpoint.
v1.0.0