【发布时间】:2021-01-05 06:59:57
【问题描述】:
在本地机器上一切正常。部署后出现问题。
部署后,/querybuilder 会附加到基本 url。
所以,
http://localhost:80/helloworld
会变成
http://52.xxx.xxx.139/querybuilder/helloworld
招摇页面:
http://52.xxx.xxx.139/querybuilder/swagger/
当我通过 swagger ui 页面执行方法时: 这是我在网络标签中看到的:
控制器:
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getHello(): string {
return this.appService.getHello();
}
}
Main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const options = new DocumentBuilder()
.setTitle('Query Builder - MongoDb Parser')
.setDescription("This is Query Builder's MongoDb Parser takes database agnostic queries and transpiles it into native MongoDb query.")
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document);
await app.listen(80);
}
bootstrap();
【问题讨论】:
标签: javascript node.js swagger nestjs