我正在寻找一种方法来在Azure中的一个停靠的NestJs应用程序中为compodoc生成的静态资产提供服务。我正在使用app.useStaticAssets(path.join(__dirname, '\\documentation'));
将该文件夹映射为公用文件夹。
..Obviously它在我的机器上工作..。
但不幸的是我在天蓝色上只收到404
api的工作方式与预期一致:
我做错了什么?
静态文件位于专用文件夹文档中
引导应用程序的main.ts:
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(ApplicationModule);
app.useGlobalPipes(new ValidationPipe({ transform: true } as ValidationPipeOptions));
SwaggerModule.setup('api', app, SwaggerModule.createDocument(app, new DocumentBuilder()
.setTitle('N Playground')
.setDescription('A NestJs Playground API')
.setVersion('0.1')
.addTag('player')
.build()));
app.useStaticAssets(path.join(__dirname, '\\documentation'));
app.useGlobalInterceptors(new StopWatchInterceptor());
const port = 8080;
app.listen(port, () => {
console.log(`Application is listening on port ${port}`);
});
}
bootstrap();
发布于 2019-04-16 09:37:31
我对此做了一些修改,通过提交我所有的Angular源文件和documentation文件夹,并在应用程序设置中更新Virtual Path,将其添加到应用程序服务中。
应用设置
Compodoc
https://stackoverflow.com/questions/55694417
复制相似问题