25 lines
759 B
TypeScript
25 lines
759 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
|
import { AppModule } from './app.module';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
const configService = app.get(ConfigService);
|
|
|
|
const config = new DocumentBuilder()
|
|
.setTitle('Icy Network DNS API')
|
|
.setDescription('Authorize DNS zone changes using a REST API')
|
|
.setVersion('1.0')
|
|
.addTag('zone')
|
|
.build();
|
|
const document = SwaggerModule.createDocument(app, config);
|
|
SwaggerModule.setup('api/v1', app, document);
|
|
|
|
await app.listen(
|
|
configService.get<number>('port'),
|
|
configService.get<string>('host'),
|
|
);
|
|
}
|
|
bootstrap();
|