Menyelesaikan object user dan init base

This commit is contained in:
Mr. Rayyan
2026-07-30 22:47:18 +07:00
parent 3efac50f39
commit fdbfb34842
128 changed files with 6785 additions and 3156 deletions
+48 -1
View File
@@ -1 +1,48 @@
// placeholder main.ts
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { ConfigService } from '@nestjs/config';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = app.get(ConfigService);
app.setGlobalPrefix('api');
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
transform: true,
forbidNonWhitelisted: true,
}),
);
app.enableCors();
const swaggerEnabled =
config.get<string>('SWAGGER_ENABLED') === 'true';
if (swaggerEnabled) {
const swaggerConfig = new DocumentBuilder()
.setTitle('RayLab Core API')
.setDescription('RayLab Core REST API')
.setVersion('1.0.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup('docs', app, document);
}
const port = config.get<number>('PORT') || 3000;
await app.listen(port);
console.log(`Server running on http://localhost:${port}`);
}
bootstrap();