A simple Nodejs Express Application with MongoDB backend
This is a simple example for using Nodejs and Express with MongoDB backend! to test the application
check that the server is running on http://localhost:4000/
Dependencies: Using -Nodemon -Babel to convert ES6 code to normal Javascript -Bodyparser to parse JSON files
Requirements: 1-Need Mongo DB installed and running 2-Install MongoDB and run the service For MACOS:
You can use MongoDB gui client- https://studio3t.com/
Then you can use POSTMAN to test it Run GET request: http://localhost:4000/contact This will fetch the data from the MongoDB and display as a JSON file
POST request: http://localhost:4000/contact passing the url encoded such as in CURL
curl --location --request POST 'http://localhost:4000/contact/'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'firstName=joe'
--data-urlencode 'lastName=doe
'
--data-urlencode 'email=jo@gmail.com'
--data-urlencode 'company=Accenture'
--data-urlencode 'phone=123232'