fallback to 'default' when NODE_ENV is undefined

This commit is contained in:
jesopo 2022-08-10 13:18:24 +00:00
parent 7c0d5f575c
commit 6502821454

View File

@ -170,7 +170,7 @@ const defaultConfig: IConfig = {
};
export function read(): IConfig {
const content = fs.readFileSync(`./config/${process.env.NODE_ENV}.yaml`, "utf8");
const content = fs.readFileSync(`./config/${process.env.NODE_ENV || 'default'}.yaml`, "utf8");
const parsed = load(content);
const config = {...defaultConfig, ...(parsed as object)} as IConfig;
return config;