0.1.0 • Published 4 years ago
jhkz-server v0.1.0
Nest_base_template
Nest 基础开发模板
TODO
- 增加ownerGame表,订单表多对一关联该表
功能支持
- Typescript
- Nest
- Swagger
- Env Config
- nestjs-session
- global response interceptor
- class-validator
Installation
$ npm install
Running the app
# development
$ npm run start
# watch mode
$ npm run dev
# production mode
# npm install -g pm2
# or
# yarn global add pm2
$ npm run pm2
# or
$ npm run prod
Test
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
License
Nest is MIT licensed.
DB迁移
开发环境自动同步数据库架构,生产数据库则在实体变更后生成迁移脚本
创建新迁移
yarn typeorm migration:create -n [entitiesName]
从现有表结构迁移
yarn typeorm migration:generate -n [entitiesName]
运行迁移
yarn typeorm migration:run
撤销上次迁移
yarn typeorm migration:revert
同步数据库架构
yarn typeorm schema:sync
删除数据库架构
yarn typeorm schema:drop
0.1.0
4 years ago