This project is about integrating mongo CRUD functionalities with RESTful API's using NodeJs and ExpressJS. Four type of REST API's methods are mentioned that are GET, POST, PUT, DELETE and each method is integrated with mongo according to it's properties.
- GET method to fetch data from database collection.
- POST method to add data to database collection.
- PUT Method to update data of database collection.
- DELETE Method to delete data from database collection.
These instructions will get you a basic requirements to run this project.
Before you start coding you have to install some Node Package Modules.
- Fast, unopinionated, minimalist web framework for node
- CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.
- dotenv is used to store the static value in .env .
- To handle HTTP POST request in Express.js, you need to install middleware module which is body-parser.
- Body-parser extract the entire body portion of an incoming request stream and exposes it on req.body.
- This body-parser module parses the JSON, buffer, string and URL encoded data submitted using HTTP POST request.
- This module is very usefule for validation of data.
- nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
-
- MongoDB (Database)
- Runs the app in the development mode.
- Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.