Initial commit after migration to gitea

This commit is contained in:
2026-01-18 11:27:43 +03:30
parent a21039410c
commit ea4b8eb543
196 changed files with 45567 additions and 9 deletions

45
src/main.ts Normal file
View File

@@ -0,0 +1,45 @@
import { NestFactory } from "@nestjs/core";
import { NestExpressApplication } from "@nestjs/platform-express";
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
import * as basicAuth from "express-basic-auth";
import { AppModule } from "./app.module";
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
cors: true,
});
app.enableCors();
app.enableCors({
origin: "*",
methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS",
allowedHeaders: "Content-Type, Authorization",
});
app.use(
["/docs", "/docs-json", "/swagger"],
basicAuth({
challenge: true,
users: {
[process.env.SWAGGER_USER]: process.env.SWAGGER_PASSWORD,
},
}),
);
const config = new DocumentBuilder()
.setTitle("yara724-backend")
.setVersion("1.0.0")
.addServer(process.env.BASE_URL + "/api")
.addServer(process.env.URL)
.addServer("http://192.168.20.249:9001")
.addServer("http://192.168.20.170:9001")
.addServer("http://localhost:9001")
.addBearerAuth()
.build();
const docs = SwaggerModule.createDocument(app, config);
SwaggerModule.setup("/docs", app, docs);
await app.listen(process.env.PORT);
}
bootstrap();