Swagger UI没有在Amazon EC2实例上显示任何内容
我已经使用Express Framework开发了Node.js应用程序,并使用“ Swagger-JSDOC”和“ Swagger-UI-Express”进行了记录。 Swagger UI正在加载我的“ Localhost:3000/V1/Docs”,并正常工作。
现在,我将其部署到Amazon EC2实例(Ubuntu,Linux),所有API都在击中和正常工作,但“ myamazonurl.com/v1/docs”正在重定向到Swagger UI,但没有显示任何东西。
我也配置了PM2和NGINX。
在控制台和网络中出现的错误是相同的,并且附加了错误。
首先点击URL:
第一个点击url”>
:
运行Swagger UI需要其他配置或设置? 有什么问题?
我很感激...
I have developed Node.js App using Express framework and documented using "swagger-jsdoc" and "swagger-ui-express".
Swagger UI is loading on my "localhost:3000/v1/docs" and working properly.
Now, I deployed it to Amazon EC2 instance (Ubuntu, Linux), all API's are hitting and working properly but "myamazonurl.com/v1/docs" are redirecting to Swagger UI but not displaying anything.
I configured pm2 and nginx as well.
Errors coming in console and network are same and they are attached.
On first hit to the URL:
On reloading the page:
Is there any additional configuration or setup is required to run Swagger UI?
What is the issue?
I'll be thankful...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需移动
app.use(helmet());
插件上方的Swagger配置: -即使尚未配置,它也强迫在HTTPS方案上找到资源。
来源: github
just move the swagger configuration above the
app.use(helmet());
plugin :-it is forcing to find resources on https scheme, even if it's not configured yet.
Source: Github