-
This commit is contained in:
parent
ff5f109544
commit
ae00a43c91
@ -1,21 +1,20 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
import path from 'path';
|
import path from "path";
|
||||||
|
|
||||||
const enviroment = process.env.NODE_ENV || 'development';
|
const environment = process.env.NODE_ENV || "development";
|
||||||
const isProduction = enviroment === 'production';
|
const isProduction = environment === "production";
|
||||||
const isDevelopment = enviroment === 'development';
|
const isDevelopment = environment === "development";
|
||||||
|
|
||||||
const enviromentConfig = require(path.resolve(
|
// Determina la extensión de archivo según el entorno
|
||||||
__dirname,
|
const extension = isProduction ? ".js" : ".ts";
|
||||||
'environments',
|
|
||||||
enviroment + '.ts'
|
const environmentConfig = require(path.resolve(__dirname, "environments", environment + extension));
|
||||||
));
|
|
||||||
|
|
||||||
export const config = Object.assign(
|
export const config = Object.assign(
|
||||||
{
|
{
|
||||||
enviroment,
|
environment,
|
||||||
isProduction,
|
isProduction,
|
||||||
isDevelopment,
|
isDevelopment,
|
||||||
},
|
},
|
||||||
enviromentConfig
|
environmentConfig
|
||||||
);
|
);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export const currentState = assign(
|
|||||||
appPath: process.cwd(),
|
appPath: process.cwd(),
|
||||||
//host: process.env.HOST || process.env.HOSTNAME || 'localhost',
|
//host: process.env.HOST || process.env.HOSTNAME || 'localhost',
|
||||||
//port: process.env.PORT || 18888,
|
//port: process.env.PORT || 18888,
|
||||||
environment: config.enviroment,
|
environment: config.environment,
|
||||||
connections: {},
|
connections: {},
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user