项目作者: LeeJeongYeop

项目描述 :
nayak's node.js express skeleton for REST API
高级语言: JavaScript
项目地址: git://github.com/LeeJeongYeop/nayak-express-skeleton.git
创建时间: 2017-08-20T08:17:54Z
项目社区:https://github.com/LeeJeongYeop/nayak-express-skeleton

开源协议:MIT License

下载


nayak-express-skeleton

This is a very lightweight Node.js Express REST API structure.
(MySQL, MariaDB Base)

Getting Started

Installing

  1. $ git clone git@github.com:LeeJeongYeop/nayak-express-skeleton.git
  2. $ cd nayak-express-skeleton
  3. $ npm install

Start Server

  1. $ npm start

Structure

  1. nayak-express-skeleton
  2. ├─┬ config
  3. ├── config.js
  4. ├── logger.js
  5. └── ParamValidation.js
  6. ├─┬ controllers
  7. ├── AuthCtrl.js
  8. └── index.js
  9. ├─┬ models
  10. ├── AuthModel.js
  11. └── TransactionWrapper.js
  12. ├─┬ routes
  13. ├── index.js
  14. └── ServiceRouter.js
  15. ├── app.js
  16. ├── ErrorHandler.js
  17. ├── errors.json
  18. ├── LICENSE
  19. ├── package.json
  20. ├── package-lock.json
  21. ├── README.md
  22. └── 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.

License

This project is licensed under the MIT License