Skip to content

Mubangizi/blog-api

Repository files navigation

CircleCI

Blop Api

An Api that provides CRUD for blog posts and commenting on corresponding posts

Table of API routes

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

Prerequisite for project

Clone

  • 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

Installation of prerequisites

Installing dependencies

  • To install the required dependencies, run the command npm install

Start the app

  • To start the app run the command npm start App will start on your local host
  • To start development environment, run npm run dev

To see api docs for the app

  • Once the app is running got to browser enter <hostUrl:port>/api-docs endpoint.

Testing:

  • To test the app run command npm test
  • Mocha Chai

Version

  • v1.0.0

About

Allows user to post and comment on posts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published