-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
23 lines (21 loc) · 1.03 KB
/
main.ts
File metadata and controls
23 lines (21 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger';
import { Logger, ValidationPipe } from '@nestjs/common';
async function bootstrap() {
const port: number | string = process.env.PORT || 3000;
const app = await NestFactory.create(AppModule);
const swaggerConfig = new DocumentBuilder()
.setTitle("Game Server Tracker - API")
.setDescription(`A API which shows several information on a server Minecraft / Source (Gmod, CS, CSGO) / FiveM`)
.setVersion("1.0")
.setContact("BliTz_37", "https://github.com/BliTz037", "blitz@blitzlab.ninja")
.build();
const swaggerDocument: OpenAPIObject = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup('api-docs', app, swaggerDocument);
app.useGlobalPipes(new ValidationPipe({ disableErrorMessages: false, whitelist: true }))
app.enableCors();
await app.listen(port);
Logger.log(`GST API is running. Listening on port ${port}`, "Bootstrap");
}
bootstrap();