Добавлена возможность самостоятельно указать порт (по умолчанию 5050)

This commit is contained in:
2024-09-13 00:39:47 +04:00
parent 175bc115ff
commit 9ad5beb611
2 changed files with 6 additions and 2 deletions

View File

@@ -10,3 +10,7 @@ export const httpsConstants = {
certPath: process.env.CERT_PEM_PATH!, certPath: process.env.CERT_PEM_PATH!,
keyPath: process.env.KEY_PEM_PATH!, keyPath: process.env.KEY_PEM_PATH!,
}; };
export const apiConstants = {
port: process.env.API_PORT ?? 5050,
};

View File

@@ -4,7 +4,7 @@ import { ValidatorOptions } from "class-validator";
import { PartialValidationPipe } from "./utility/validation/partial-validation.pipe"; import { PartialValidationPipe } from "./utility/validation/partial-validation.pipe";
import { ClassValidatorInterceptor } from "./utility/validation/class-validator.interceptor"; import { ClassValidatorInterceptor } from "./utility/validation/class-validator.interceptor";
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger"; import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
import { httpsConstants } from "./contants"; import { apiConstants, httpsConstants } from "./contants";
import * as path from "node:path"; import * as path from "node:path";
import * as fs from "node:fs"; import * as fs from "node:fs";
@@ -40,7 +40,7 @@ async function bootstrap() {
]; ];
SwaggerModule.setup("api-docs", app, swaggerDocument); SwaggerModule.setup("api-docs", app, swaggerDocument);
await app.listen(43373); await app.listen(apiConstants.port);
} }
bootstrap().then(); bootstrap().then();