first commit
This commit is contained in:
commit
02255d7240
36 files changed
+13591
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { SwaggerModule, DocumentBuilder, SwaggerCustomOptions } from '@nestjs/swagger';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Cats example')
|
||||
.setDescription('The cats API description')
|
||||
.setVersion('1.0')
|
||||
.addTag('cats')
|
||||
.build();
|
||||
const options: SwaggerCustomOptions = {
|
||||
ui: false, // Swagger UI is disabled
|
||||
raw: ['yaml'], // JSON API definition is still accessible (YAML is disabled)
|
||||
}
|
||||
const documentFactory = () => SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup('api', app, documentFactory, options);
|
||||
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
}
|
||||
bootstrap();
|
||||
Reference in new issue
Block a user