This is a very lightweight Node.js Express REST API structure. (MySQL, MariaDB Base)
$ git clone git@github.com:LeeJeongYeop/nayak-express-skeleton.git
$ cd nayak-express-skeleton
$ npm install
$ npm start
nayak-express-skeleton
├─┬ config
│ ├── config.js
│ ├── logger.js
│ └── ParamValidation.js
├─┬ controllers
│ ├── AuthCtrl.js
│ └── index.js
├─┬ models
│ ├── AuthModel.js
│ └── TransactionWrapper.js
├─┬ routes
│ ├── index.js
│ └── ServiceRouter.js
├── app.js
├── ErrorHandler.js
├── errors.json
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
└── server.js config
- config: The configuration file management directory required for the project.
- config.js: [Must be gitignore] Fill in the settings required. (example. DB connection information, Crypto, JWT)
- logger.js: Logging config file. (used Winston)
- ParamValidation.js: Validates the request parameters. (used express-validation)
- models: Write a query and associate it with the database.
- TransactionWrapper.js: Transaction management based on promise.
- controllers: Manage requests and responses, and process data.
- ErrorHandler: Handles the error, and references errors.json.
- errors.json: Lists error conditions.
This project is licensed under the MIT License