linkkf 수정3
This commit is contained in:
14
nest_api/anime-api/src/config/config.ts
Normal file
14
nest_api/anime-api/src/config/config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import * as yaml from 'js-yaml';
|
||||
import { join } from 'path';
|
||||
|
||||
const YAML_CONFIG_PROD = 'production.yaml';
|
||||
const YAML_CONFIG_DEV = 'development.yaml';
|
||||
|
||||
export default () => {
|
||||
return yaml.load(
|
||||
process.env.NODE_ENV === 'production'
|
||||
? readFileSync(join(__dirname, YAML_CONFIG_PROD), 'utf8')
|
||||
: readFileSync(join(__dirname, YAML_CONFIG_DEV), 'utf8'),
|
||||
) as Record<string, any>;
|
||||
};
|
||||
2
nest_api/anime-api/src/config/development.yaml
Normal file
2
nest_api/anime-api/src/config/development.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
server:
|
||||
port: 7070
|
||||
2
nest_api/anime-api/src/config/production.yaml
Normal file
2
nest_api/anime-api/src/config/production.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
server:
|
||||
port: 3003
|
||||
Reference in New Issue
Block a user