A template to get started with creating REST APIs using NodeJs, ExpressJS, MongoDB with JWT for authentication.
.
└── src
├── controllers
├── db
├── errors
├── middlewares
├── models
├── routes
├── services
├── utils
└── app.js
├── package.json
Git clone the repository and run npm install
git clone https://github.com/ankushk1729/node-express-mongo-template
cd node-express-mongo-template
npm install
To run this project, you will need to add the following environment variables to your .env file
JWT_SECRET
MONGO_URI
ACCESS_TOKEN_EXPIRY
REFRESH_TOKEN_EXPIRY
Start the server in development mode
npm run dev
Start the server in production mode
npm start