This commit is contained in:
David Arranz 2024-09-08 21:20:19 +02:00
parent ff5f109544
commit ae00a43c91
2 changed files with 15 additions and 16 deletions

View File

@ -1,21 +1,20 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import path from 'path';
import path from "path";
const enviroment = process.env.NODE_ENV || 'development';
const isProduction = enviroment === 'production';
const isDevelopment = enviroment === 'development';
const environment = process.env.NODE_ENV || "development";
const isProduction = environment === "production";
const isDevelopment = environment === "development";
const enviromentConfig = require(path.resolve(
__dirname,
'environments',
enviroment + '.ts'
));
// Determina la extensión de archivo según el entorno
const extension = isProduction ? ".js" : ".ts";
const environmentConfig = require(path.resolve(__dirname, "environments", environment + extension));
export const config = Object.assign(
{
enviroment,
isProduction,
isDevelopment,
},
enviromentConfig
{
environment,
isProduction,
isDevelopment,
},
environmentConfig
);

View File

@ -23,7 +23,7 @@ export const currentState = assign(
appPath: process.cwd(),
//host: process.env.HOST || process.env.HOSTNAME || 'localhost',
//port: process.env.PORT || 18888,
environment: config.enviroment,
environment: config.environment,
connections: {},
},
config