A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
克隆本项目
git clone https://github.com/rabbitkiller-dev/node-nestjs-shorturl
安装依赖(node_modules)
npm install
- 使用mysql数据库(按需) 修改ormconfig.json
{
"type": "mysql",
"host": "ip::::",
"port": 3306,
"username": "username",
"password": "password",
"database": "database",
"synchronize": true,
"logging": true,
"entities": ["dist/**/*.entity{.ts,.js}"]
}
- 修改docker-compose.yml
- 修改ports(按需)
- 修改重定向地址前缀(SHORT_URL_PREFIX)
environment:
- SHORT_URL_PREFIX=https://xxxxxx.dev/s
启动
docker-compose up -d