-
yarn add @nestjs/swagger swagger-ui-express
-
使用
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.setGlobalPrefix('api'); const options = new DocumentBuilder() .setTitle('博客API') .setDescription('测试用') .setVersion('1.0.0') .build(); const document = SwaggerModule.createDocument(app, options) SwaggerModule.setup('api', app, document) await app.listen(3000); } bootstrap();
-
Notifications
You must be signed in to change notification settings - Fork 0
itxcr/nest-swagger
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published