Swagger Sails JS 呈现为 JSON

Swagger Sails JS rendered as JSON

为了获得一个 swagger 文档,我完全按照 Nitheesh K P 在解决方案中的建议进行操作。当我访问 url /swagger/doc 时,我能够得到 swagger 输出,但它看起来像一个 REST 响应。它缺乏我期待的美景,就像 http://swagger.balderdash.io.

中的那样

换句话说,我遵循了:https://github.com/tjwebb/sails-swagger 并获得了 REST 响应而不是 swagger 文档。

请帮我弄清楚我错过了什么? Sails中的一些基本配置。

您引用的 Sails 或 Swagger 挂钩似乎都没有包含 Swagger UI. You should install and configure Swagger UI in a separate process - see this SO answer 以获取更多详细信息。