RESTfull API build on :
- NodeJS Language
- Express Framwork
- MVC Pattern
- Depedencies : body-parser, express, mongoose
- Mongo DB Community
NodeJS required Link v15.* to run NPM required Link v7.* to run Mongo DB Community required Link
- Download or Clone from Github -
cd nodejs_restfullapi_express_mongo
touch .env
echo "PORT=:8000" >> .env
echo "MONGODB=mongodb://{yourhost}/{yourcollection}" >> .env
Running Code
npm install
npm start
METHOD | ENDPOINT | Description |
---|---|---|
GET | http://{yourhost}:8000/api/contacts | GET ALL Contacts |
GET | http://{yourhost}:8000/api/contact/{id} | GET ONE Contact |
POST | http://{yourhost}:8000/api/contact | CREATE Contact |
PUT | http://{yourhost}:8000/api/contact/{id} | UPDATE Contact |
DELETE | http://{yourhost}:8000/api/contact/{id} | DELETE Contact |
File on Directory demo/postman
MIT