At the beginning

To support this project, you will need to install the following environment (please install it yourself, which is not described here) :

  1. Nodejs > = 7.6 x
  2. mysql

Optional (auxiliary software) :

  1. Navicat Premium 15 (Database Management Tool)
  2. Postman (Interface Testing)

Project introduction

In the spirit of exploration to the JS world of node background, want to try the advantages and disadvantages of Node as a server and use JS to write the server curiosity, so this project was born, just as a demo to learn or help the students who have just entered the node, writing is not good, welcome big guy to give advice, I will continue to update when there is time. 🐶

The front end is mainly vue2. X scaffolding project. In this project, the front end is not the focus, mainly the back end.

The back end is mainly based on KOA2 and various KOA middleware, as you can see in the package.

If you are interested, you can go to the following warehouse to check the front-end address: gitee.com/Dark2017/vu… Back-end address: gitee.com/Dark2017/no…

Back-end directory structure

├ ─ node - serve │ ├ ─ controllers -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- interface logic │ │ ├ ─ common │ │ │ └ ─ index. The js │ │ └ ─ other │ │ └ ─ Index. Js │ ├ ─ db -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- connect to the database │ │ └ ─ index. The js │ ├ ─ Koa. Js -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- main entrance │ ├ ─ logs -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- log storage directory │ │ ├ ─ access. A log2021-03-09.│ ├ ─ garbage2021-03-09.Log │ ├ ─ middleware -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- middleware │ │ ├ ─ logger. Js │ │ └ ─ the schedule. The js │ ├ ─ Package - lock. Json -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- locked rely on │ ├ ─ package. The json -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- rely on │ ├ ─ Public -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- static resource directory (temporary) │ ├ ─ README. Md -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- introduced │ ├ ─ The route -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- routing │ │ └ ─ index. The js │ └ ─ utils -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - tools │ ├ ─ HttpCode. Js │ └ ─ utils. JsCopy the code