#Blog-app
A simple REST blog app built with node, express and mongodb.
These instruction will guide you to get a copy of the project and running on your local machine for development.
- Node.js - install from node.js website
- npm - comes with Node.js
- Mongo db
- express - a web application framework for node.js
- mongoose - a MongoDB ODM (the NoSQL equivalent of an ORM) for Node
- body-parser - parse incoming request bodies in a middleware before your handlers
- nodemon - automatically reload node server, however not necessary.
- Clone the repository
git clone https://github.com/NibeshSdev/blog-app.git
- Install all dependencies
npm install
- Run the mongo server
You need to install mongo globally to use the following command.
mongod
Otherwise go to mongo installation directory > bin > mongod.exe
- Run the application
npm run start
Then use the following URLs for fetching, inserting, updating and deleting data.
-
get_all_posts - GET http://localhost:3000/api/posts
-
create_a_post - POST http://localhost:3000/api/posts
-
get_post_by_id - GET http://localhost:3000/api/posts/{postId}
-
update_post_by_id - PUT http://localhost:3000/api/posts/{postId}
-
delete_post_by_id - DELETE http://localhost:3000/api/posts/{postId}
- Nibesh Shankhadev