diff --git a/src/contants.ts b/src/contants.ts index 1554390..821a5b3 100644 --- a/src/contants.ts +++ b/src/contants.ts @@ -10,3 +10,7 @@ export const httpsConstants = { certPath: process.env.CERT_PEM_PATH!, keyPath: process.env.KEY_PEM_PATH!, }; + +export const apiConstants = { + port: process.env.API_PORT ?? 5050, +}; diff --git a/src/main.ts b/src/main.ts index 9a94969..33e4a6c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import { ValidatorOptions } from "class-validator"; import { PartialValidationPipe } from "./utility/validation/partial-validation.pipe"; import { ClassValidatorInterceptor } from "./utility/validation/class-validator.interceptor"; import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger"; -import { httpsConstants } from "./contants"; +import { apiConstants, httpsConstants } from "./contants"; import * as path from "node:path"; import * as fs from "node:fs"; @@ -40,7 +40,7 @@ async function bootstrap() { ]; SwaggerModule.setup("api-docs", app, swaggerDocument); - await app.listen(43373); + await app.listen(apiConstants.port); } bootstrap().then();