问题标签 [swagger-jsdocs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
19 浏览

node.js - SwaggerJSDoc:找不到本地主机:3000

我对 SwaggerJSDoc 有疑问。我已经安装了它并遵循了文档(参考:https ://github.com/Surnet/swagger-jsdoc )。

这是我的配置文件:

在我的/src文件夹中,我放置了一些名为的嵌套文件夹docs,其中包含.yaml描述各种 api 的文件。如果我console.log保持不变,我可以看到所有这些文件的内容,openapiSpecification以便该部分正常工作。

这是我app.ts归档的地方:

问题是,当我运行服务器时,localhost:3000/docs出现错误: 在此处输入图像描述

我怎样才能解决这个问题?