fix(security): completely remove Swagger UI endpoint mounting from runtime
Deploy Canina / deploy (push) Failing after 11s
Deploy Canina / deploy (push) Failing after 11s
This commit is contained in:
1 parent
5a483e0cce
commit
7a103303b0
1 file changed
+1
-19
+1
-19
@@ -3,7 +3,6 @@ import { NestExpressApplication } from "@nestjs/platform-express";
|
||||
import { AppModule } from "./app.module";
|
||||
import { join } from "path";
|
||||
import { ValidationPipe, BadRequestException } from "@nestjs/common";
|
||||
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
|
||||
import { CustomHttpExceptionFilter } from "./common/filters/http-exception.filter";
|
||||
import { PrismaExceptionFilter } from "./common/filters/prisma-exception.filter";
|
||||
import { DecimalInterceptor } from "./common/interceptors/decimal.interceptor";
|
||||
@@ -144,24 +143,7 @@ async function bootstrap() {
|
||||
|
||||
app.useGlobalInterceptors(new DecimalInterceptor());
|
||||
|
||||
const isSwaggerEnabled = process.env.ENABLE_SWAGGER === "true";
|
||||
|
||||
if (isSwaggerEnabled) {
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle("Canina Iran API")
|
||||
.setDescription(
|
||||
"API Documentation for Canina Iran Pet Health & Supplement Platform",
|
||||
)
|
||||
.setVersion("1.0.0")
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup("api/docs", app, document);
|
||||
console.log("Swagger UI is ACTIVE on /api/docs");
|
||||
} else {
|
||||
console.log("Swagger UI is DISABLED for security");
|
||||
}
|
||||
// Swagger UI is permanently disabled across all environments for security
|
||||
|
||||
await app.listen(process.env.PORT ?? 4001);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user