<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 其他特性 ### 全局前綴 要忽略一個通過`setGlobalPrefix()`配置的全局前綴, 使用`ignoreGlobalPrefix`: ```TypeScript const document = SwaggerModule.createDocument(app, options, { ignoreGlobalPrefix: true, }); ``` ### 多重聲明 `Swagger`模塊提供了一個支持多重聲明的方法,也就是說可以在多個終端提供多個界面和多個文檔。 要支持多重聲明,首先在模塊中要進行聲明,在`createDocument()`方法中傳遞第3個參數,`extraOptions`,這是個包含一個叫做`include`名稱的屬性,該屬性提供了一個由模塊組成的數組。 可以如下配置多重聲明: ```TypeScript import { NestFactory } from '@nestjs/core'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); /** * createDocument(application, configurationOptions, extraOptions); * * createDocument method takes an optional 3rd argument "extraOptions" * which is an object with "include" property where you can pass an Array * of Modules that you want to include in that Swagger Specification * E.g: CatsModule and DogsModule will have two separate Swagger Specifications which * will be exposed on two different SwaggerUI with two different endpoints. */ const options = new DocumentBuilder() .setTitle('Cats example') .setDescription('The cats API description') .setVersion('1.0') .addTag('cats') .build(); const catDocument = SwaggerModule.createDocument(app, options, { include: [CatsModule], }); SwaggerModule.setup('api/cats', app, catDocument); const secondOptions = new DocumentBuilder() .setTitle('Dogs example') .setDescription('The dogs API description') .setVersion('1.0') .addTag('dogs') .build(); const dogDocument = SwaggerModule.createDocument(app, secondOptions, { include: [DogsModule], }); SwaggerModule.setup('api/dogs', app, dogDocument); await app.listen(3000); } bootstrap(); ``` 現在可以使用以下命令啟動服務器: ```bash $ npm run start ``` 訪問`http://localhost:3000/api/cats`以查看`cats`的 Swagger UI: ![](https://docs.nestjs.com/assets/swagger-cats.png) 反過來,`http://localhost:3000/api/dogs`將為`dogs`公開 Swagger UI: ![](https://docs.nestjs.com/assets/swagger-dogs.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看