1

我是新来的。

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

我尝试了 django-rest-swagger,但由于缺乏文档,我无法使我的代码适合文档。因此,我正在尝试使用 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.
4

2 回答 2

0

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

npm cache clean
rm -rf node_modules
npm install
bower cache clean 
rm -rf app/bower_components
bower install
npm start
于 2015-02-25T17:00:36.143 回答
-1

我遇到了同样的问题。
以前我的节点版本是最新的 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

于 2016-05-13T08:25:44.520 回答