Node JS most famous framework isExpress. Many developer recommends express framework to write the back-end code. People are using express because it is customizable backend scripting language, code can be written in pure js (ES5 or ES6), now today's world we can also write back-end code by using typescript.
In this project we will use swagger routes with middlewares. It makes our API documentation much more attractive and understandable. So any one back-end developer can understand, what's going on.
Mongodb 4.0+
- Install MonngDB 4.0+
Ref:https://docs.mongodb.com/manual/installation/- Connetion String (mongodb://>:@localhost:27017/example)
NodeJS v8+
Ref:Learn Node- Framework: Learn Express
- Clone the project:
https://<username>@bitbucket.org/webzoolll/rspbackend.git- Go to project working directory / Project folder
- Execute command
npm install - After that Run Command
npm start - Open
http://localhost:4007to check that your server is running or not.
- No need to set custom environment variable, if you want to set any environment variable just add it to
.envfile. - Set port by writing one line PORT=4007 for running server, there is no default port available in code so you need to set PORT.
- config -> .env_sample will let you know about the system variables which this project requires
- There is a
npm modulecalleddotenvwill configure environment variable from.envto our system..envis the default environment file which will automatically configured by thedotenv; - You need to require
dotenvon the to of the index.js file - i.e
require('dotenv').config()