小岛管家后台
├── README.md
├── controller
├── index.ts
├── middleware
│ ├── logger.ts
│ └── request.ts
├── package.json
├── router
│ └── index.ts
├── service
index.ts
:项目入口文件router
:路由文件目录controller
:路由控制器目录,处理路由的业务逻辑service
:路由服务目录,处理和数据库相关的交互middleware
:中间件目录,Koa
的核心**,洋葱模型,参考https://koajs.com/#application
- eslint,配置参考
.eslintrc.js
- husky,git钩子工具,https://typicode.github.io/husky/,配置参考
.husky
目录 - commitlint,git提交信息校验工具,https://commitlint.js.org/#/,配置参考
commitlint.config.js
;建议使用git commit -m ':tada: 初始化项目'
的格式,当前强校验前缀,前缀内容参考https://gitmoji.carloscuesta.me/ - validate-branch-name,分支名校验工具,https://github.com/JsonMa/validate-branch-name,当前强校验分支名必须以
feature
或bugfix
开头,例如:feature/test
注意:项目使用 yarn 作为包管理器
git clone git@github.com:HenryYangs/koa-small-island.git
cd koa-small-island
yarn install
yarn run dev
yarn run build