Building a CRUD App using Node, Express, Mongodb and Mongoose. CRUD application in Node.js by using MEN stack
REST API that can:
- request data from HTTP server (GET)
- send data to HTTP server and save in database (POST)
Sample client request:
- GET https://localhost:9000/[var]
- GET https://localhost:9000/[var]/[id]
- POST https://localhost:9000/[var]
- PATCH https://localhost:9000/[var]/[id]
- Web browser: Platform for client to request and send data
- Node.js: Runtime
- Express: Framework to maintain code
- MongoDB: Database
- POSTMAN: API tester (Download desktop version to test API)
- VSCode: Editor
- Clone the repository
- npm install express, npm install mongodb, npm install mongoose for production purpose
- npm -g install nodemon --save-dev for development purpose
Insert body message as JSON format and follow database Schema (required for all), then POST https://localhost:9000/aliens
GET https://localhost:9000/aliens
GET https://localhost:9000/aliens/[id]
Insert updated body message as JSON format (not required for all), then PATCH https://localhost:9000/aliens/[id]