createexpressapp
-> npx configure-express-app@latest
Note* : npx configure-express-app Don't use this command for existing project
Using this command to create express app
npx configure-express-app@latest
Auto detect the node version then install the dependencies and create express app based upon the node version.
Example:
// In node version 20 don't need this env import, Node js supports .env default.
require('dotenv').config();
// Use in package.json this line
node --env-file=.env server.js
- Express framework
- Nodemon dev dependencies
- logger ( winston logger)
- .env file included
- automatically request id generate in requests ( uuid V4)
- compression added
- helmet added
- Error handler added
- CORS middleware added
- Body parser middleware added
- Every request body and params and query and headers are capture
- hpp middeware added
- express-mongo-sanitize middleware added
- .gitigonre added
- prittier added
- Database connection
You can able to choose which databse are you want to use ?
- PostgreSQL
- MongoDB
- None
If you choose any one, create sample db connection in database directory.
You can change the database connections in .env file
Finishing all the setup to run the project:
-> npm run dev
Then successfully run the express application.
-> npm run prettify
- you using this command to correct the code as beautifull format.
If any doubt ask me
Contact:
Email -> saravanakumara512@gmail.com
Phone -> 6381192018