mirror of
https://github.com/KwiTsukasa/kt-template-online-api.git
synced 2026-05-27 15:44:54 +08:00
chore: align api env file modes
This commit is contained in:
parent
94fe524335
commit
b98c49f383
@ -67,7 +67,7 @@ src
|
|||||||
|
|
||||||
## 环境变量
|
## 环境变量
|
||||||
|
|
||||||
项目默认读取 `.env`,生产环境会读取 `.env.prod`。
|
项目默认读取 `.env.development`,生产环境读取 `.env.production`。仓库只提交 `.env.example`,真实环境配置保留在本地。
|
||||||
|
|
||||||
```env
|
```env
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
"start": "nest start",
|
"start": "nest start",
|
||||||
"start:dev": "nest start --watch",
|
"start:dev": "nest start --watch",
|
||||||
"start:debug": "nest start --debug --watch",
|
"start:debug": "nest start --debug --watch",
|
||||||
"start:prod": "nest build && cross-env NODE_ENV=prod node dist/main",
|
"start:prod": "nest build && cross-env NODE_ENV=production node dist/main",
|
||||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
||||||
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
|
|||||||
@ -14,9 +14,7 @@ import { SaveBodyInterceptor } from './common';
|
|||||||
imports: [
|
imports: [
|
||||||
ConfigModule.forRoot({
|
ConfigModule.forRoot({
|
||||||
isGlobal: true,
|
isGlobal: true,
|
||||||
envFilePath: `.env${
|
envFilePath: `.env.${process.env.NODE_ENV || 'development'}`,
|
||||||
process.env.NODE_ENV ? `.${process.env.NODE_ENV}` : ''
|
|
||||||
}`,
|
|
||||||
}),
|
}),
|
||||||
TypeOrmModule.forRootAsync({
|
TypeOrmModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
imports: [ConfigModule],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user