在本地运行的 Swagger-Editor 显示空页面



我是招摇的新手。

我在 django-rest-framework 中创建了 API。我想记录它们。因此阅读有关招摇的信息。

尝试了django-rest-swagger,但由于缺乏文档,我无法使我的代码适合文档。因此,我正在尝试大摇大摆的编辑器,这将允许我从头开始设计 API 结构。我已经在本地安装了它,但它在"127.0.0.1:9000"处显示空白页面。我现在该怎么办?

我想编写将由本地安装的 swagger-editor 使用的 YAML 或 JSON 文件。我怎样才能做到这一点?

这是我加载 127.0.0.1:9000 时控制台上的错误

Warn: could not find module util
http://127.0.0.1:9000/bower_components/angular-schema-form/dist/schema-form.js Failed to load resource: the server responded with a status of 404 (Not Found)
angular.js:80 Uncaught Error: [$injector:nomod] Module 'schemaForm' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.2/$injector/nomod?p0=schemaForm
angular.js:80 Uncaught Error: [$injector:modulerr] Failed to instantiate module PhonicsApp due to:
Error: [$injector:modulerr] Failed to instantiate module schemaForm due to:
Error: [$injector:nomod] Module 'schemaForm' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

我不确定这里有什么问题。作为一般说明,您始终可以清理 npm 和 Bower 模块,然后再次从干净状态开始。

npm cache clean
rm -rf node_modules
npm install
bower cache clean 
rm -rf app/bower_components
bower install
npm start

我遇到了同样的问题。
以前我的节点版本是最新的 v6
我重新安装了所有内容,然后安装了v4.4.4

node --v

确保它是v4.4.4

npm install -g http-server
wget https://github.com/swagger-api/swagger-editor/releases/download/v2.10.1/swagger-editor.zip
unzip swagger-editor.zip
http-server

不要使用 http-server swagger-editor

最新更新