Express.js boilerplate code for writing efficient web server. This boiler plate contains bare minimum code required for webserver with assoiciation of routes and contollers with specific services.
+-- package.json
+-- package-lock.json
+-- .gitignore
+-- src
+-- index.js
+-- controllers
+-- index.js
+-- user.controller.js
+-- services
+-- index.js
+-- user.service.js
+-- routes
+-- index.js
+-- user.routes.js
+-- models
+-- index.js
+-- user.model.js
+-- _utils
+-- dbConnect.js
+-- responseHandler.js
- Express -> Web server
- Dotenv -> Configure ENV variable
- Morgan -> Request logger
- CORS -> CORS policy configurations
- Mongoose -> MongoDB ORM
- Clone the Repo
- Create
.env
fiile in root directory and put following variables in it
PORT = 1234
DB_URL = yourdburl
- Run command
npm install
in order to install all the dependencies - Run one of the following script
$ npm run dev
$ npm start
Made with ❤️ by Jack