Files
simple-storage/src/main.ts
Николай Вигдоров c72a21db4a add env process
2025-03-06 22:04:07 +03:00

30 lines
827 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { APP_CONTROLLER, APP_PORT } from './consts';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const options = new DocumentBuilder()
.addSecurity('apiKey', {
type: 'apiKey',
in: 'header',
name: 'Authorization',
})
.setTitle('Storage API')
.setDescription('API для работы с хранилищами')
.setVersion('1.0.0')
.addTag(APP_CONTROLLER)
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document);
console.log(`Application is starting on port ${APP_PORT}`);
await app.listen(APP_PORT);
}
void bootstrap();