Skip to content

ApiREST with NodeJS, Express, MongoDB and Postman. Model View Controller (MVC) design pattern and validation with JSON Web Token (JWT).

Notifications You must be signed in to change notification settings

kevinmadrid-dev/nodejs-apirest

Repository files navigation

ApiREST with NodeJS + Express + MongoDB & MVC

Description

ApiREST with NodeJS, Express, MongoDB and Postman. Model View Controller (MVC) design pattern and validation with JSON Web Token (JWT).

Technologies

  • JavaScript
  • Node.JS
  • Express.JS
  • MongoDB
  • Postman

Aditionals Commets

Project completed.

Getting started

↓ Installation of CORS (Cross-Origin Resource Sharing), Dotenv: Library to load variables and Multer: Middleware to handle file uploads.

npm i cors dotenv multer

↓ Installation of the express validator, which filters the data before it reaches the controller.

npm i express-validator --S

↓ Installation of plugin to delete by soft-delete.

npm i mongoose-delete --save

↓ Installation of the json web token (JWT) for session control.

npm i jsonwebtoken --save

↓ Installation of bcrypt and bcryptjs to encrypt data.

npm i bcryptjs bcrypt --save

↓ Start app.js using node.

node app.js

↓ Installation of a package to automatically restart the connection in case of code changes.

npm i nodemon -g

↓ Add inside the “scripts” section in package.json.

"start": "node ./app.js",
"dev": "nodemon ./app.js",

↓ Start the project with nodemon.

npm run start:dev

IMPORTANT: Keep the terminal running for the correct execution of the app.

Developer contact

LinkedIn

About

ApiREST with NodeJS, Express, MongoDB and Postman. Model View Controller (MVC) design pattern and validation with JSON Web Token (JWT).

Resources

Stars

Watchers

Forks