Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gongzili456/nodejs-base-boilerplate
A boilerplate for server-side based koa.js, support run in docker
https://github.com/gongzili456/nodejs-base-boilerplate
babeljs boom config docker docker-compose joi koa-router koajs yaml
Last synced: 1 day ago
JSON representation
A boilerplate for server-side based koa.js, support run in docker
- Host: GitHub
- URL: https://github.com/gongzili456/nodejs-base-boilerplate
- Owner: gongzili456
- Created: 2018-01-04T17:17:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-10T02:32:37.000Z (over 6 years ago)
- Last Synced: 2024-10-19T02:28:13.558Z (30 days ago)
- Topics: babeljs, boom, config, docker, docker-compose, joi, koa-router, koajs, yaml
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 3
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 项目模板
## How to run
Develop on your local env:
`yarn dev` used docker or not `yarn debug-local`
## 项目目录
```
├── .babelrc
├── .eslintignore
├── .eslintrc.yml
├── .git-commit-template
├── .gitignore
├── README.md
├── app
│ ├── controllers
│ │ └── .gitkeep
│ ├── index.js
│ ├── models
│ │ └── .gitkeep
│ └── routers
│ ├── index.js
│ └── other.js
├── config
│ ├── development.yml
│ ├── production.yml
│ └── staging.yml
├── index.js
├── package.json
└── yarn.lock
```* package.json: 项目描述文件
* app: 所有业务逻辑代码
* controllers: 控制器层目录
* models: 数据模型层目录
* routers: 路由目录
* index.js: 业务代码主文件
* config: 项目配置目录
* development.yml: 开发环境配置文件
* production.yml: 生产环境配置文件
* staging.yml: 预生产环境配置文件
* index.js: 项目主文件
* .babelrc: Babel 配置文件,定义 ES5 转义规则
* .eslintrc.yml: Eslint 配置文件, 定义代码书写规范
* .eslintignore: Eslint 忽略配置文件, 定义 Eslint 排除的目录
* .git-commit-template: git commit message 模板文件
* .gitignore: Git 忽略目录的配置文件
* .README.md: 项目文档## VSCode 配置
安装 `Prettier-Code formatter` 插件
使用 `CMD + ,` 打开 VSCode 的配置界面, 在 `USER SETTINGS` 栏里面输入下面配置
```
"editor.formatOnSave": true,
"javascript.format.enable": false,
"prettier.eslintIntegration": true,
"prettier.trailingComma": "all",
"prettier.singleQuote": true,
"prettier.semi": false
```## 代码提交
将 `git commit teplate` 配置项目中
```
git config commit.template .git-commit-template
```以后每次提交的时候只输入
```
git commit
```然后使用 `vim` 编辑文件, 保存退出后即可提交