modificada variable de entorno host en api

This commit is contained in:
2025-06-16 22:54:33 -04:00
parent 92d64db33a
commit 8216cb4e09
3 changed files with 7 additions and 8 deletions

View File

@@ -30,6 +30,6 @@ export const bootstrap = async (app: NestExpressApplication) => {
await swagger(app);
await app.listen(envs.port!, () => {
logger.log(`This application started at ${envs.host}:${envs.port}`);
logger.log(`This application started at ${envs.host_api}:${envs.port}`);
});
};

View File

@@ -2,7 +2,7 @@ import 'dotenv/config';
import * as joi from 'joi';
interface EnvVars {
HOST: string;
HOST_API: string;
ALLOW_CORS_URL: string;
PORT: number;
NODE_ENV: string;
@@ -14,12 +14,11 @@ interface EnvVars {
MAIL_HOST: string;
MAIL_USERNAME: string;
MAIL_PASSWORD: string;
}
const envsSchema = joi
.object({
HOST: joi.string().required(),
HOST_API: joi.string().required(),
ALLOW_CORS_URL: joi.string().required(),
PORT: joi.number().required(),
NODE_ENV: joi.string().required(),
@@ -46,13 +45,13 @@ export const envs = {
port: envVars.PORT,
dataBaseUrl: envVars.DATABASE_URL,
node_env: envVars.NODE_ENV,
host: envVars.HOST,
host_api: envVars.HOST_API,
allow_cors_url: envVars.ALLOW_CORS_URL,
access_token_secret: envVars.ACCESS_TOKEN_SECRET,
access_token_expiration: envVars.ACCESS_TOKEN_EXPIRATION,
refresh_token_secret: envVars.REFRESH_TOKEN_SECRET,
refresh_token_expiration: envVars.REFRESH_TOKEN_EXPIRATION,
mail_host: envVars.MAIL_HOST,
mail_username: envVars.MAIL_USERNAME,
mail_password: envVars.MAIL_PASSWORD
mail_username: envVars.MAIL_USERNAME,
mail_password: envVars.MAIL_PASSWORD,
};