Presupuestador_web/server/src/config/index.ts

20 lines
553 B
TypeScript
Raw Normal View History

2024-04-23 15:29:38 +00:00
/* eslint-disable @typescript-eslint/no-var-requires */
2024-09-08 19:20:19 +00:00
import path from "path";
2024-04-23 15:29:38 +00:00
2024-09-08 19:20:19 +00:00
const environment = process.env.NODE_ENV || "development";
const isProduction = environment === "production";
const isDevelopment = environment === "development";
2024-04-23 15:29:38 +00:00
2024-09-08 19:20:19 +00:00
// Determina la extensión de archivo según el entorno
const extension = isProduction ? ".js" : ".ts";
const environmentConfig = require(path.resolve(__dirname, "environments", environment + extension));
2024-04-23 15:29:38 +00:00
2024-10-01 10:21:08 +00:00
export const config = {
environment,
isProduction,
isDevelopment,
...environmentConfig,
};