add service and first method to controller

This commit is contained in:
Николай Вигдоров
2025-03-01 23:54:08 +03:00
parent 83ad4d43cd
commit 12b3d5b23c
10 changed files with 632 additions and 17 deletions

View File

@ -1,8 +1,28 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { APP_CONTROLLER } 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);
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();
void bootstrap();