add service and first method to controller
This commit is contained in:
22
src/main.ts
22
src/main.ts
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user