A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
node v14.17.0
npm 6.14.13
yarn 1.15.2
redis
mysql 8.0
$ yarn
# development
$ yarn start
# watch mode
$ yarn start:dev
# debug mode
$ yarn start:debug
# production mode
$ yarn start:prod
- 配置文件在setting目录下, 开发环境使用development.env , 生产环境使用prod.env
docker run --name redis -p 6379:6379 -d redis
- 如果出现错误
Error: Unknown database 'xxx'
需要先建立对应名称的数据库, DB_NAME在.env文件中配置 - 如果使用docker, 需要使用volume, 防止数据丢失
- 创建volume
docker volume create soulbound
windows优先使用此方式,docker run --name mysql -v soulbound:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -p 3306:3306 -d mysql:tag
- unix系统直接映射目录,
docker run --name mysql -v /my/own/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -p 3306:3306 -d mysql:tag
- 创建volume
- 前端swagger http://localhost:9000/api/api
- 管理端swagger http://localhost:9000/api/admin
- TypeORM https://orkhan.gitbook.io/typeorm/docs
- 支持以太坊钱包登录
- TODO...
- [] 配置 CORS_ALLOW_LIST
- [] 配置 prod.env
- TODO...
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.