我正在尝试在VM/Vagrant框中设置Swagger。我所做的是以下。无法在浏览器中打开Swagger API
i。 端口转发使用Vagrantfile
dev.vm.network "forwarded_port", guest: 3000, host: 3000, host_ip:
"127.0.0.1", auto_correct: true
II。在颠沛流离的盒子
npm install -g swagger
Create a new swagger project
swagger project create hello-world
扬鞭配置我试图打开扬鞭编辑器与命令swagger project edit -p 3000 -s
,这给
开始扬鞭编辑器。运行Swagger Editor API服务器。您可以 使GET和PUT调用http://127.0.0.1:3000/editor/spec
好像一切都是本地桌面(Windows)的完美的,所以刚刚访问了浏览器,并访问了http://localhost:3000/editor/spec
这给了我这个网站不能达到。
curl http://localhost:3000/editor/spec在虚拟机/流浪箱中工作正常。
我在这里做什么错?
是的,它现在正在工作,但不像一些文本打开实际的编辑器。你知道为什么吗? – Deamon
你的意思是“就像一些文字” - 你没有得到https://github.com/swagger-api/swagger-node/blob/master/docs/cli.md#swagger-project-edit-options-目录 ?也许你应该创建新的问题的细节和实际与预期的结果 –
你可以请看看它在这里(https://stackoverflow.com/questions/45005086/swagger-editor-isnt-opening-in-chrome-version -59-0-3071-115官方建造-6)?在Windows中同样的事情工作得很好。我的意思是,我可以看到那里显示的确切窗口。但是使用流浪者的虚拟机设置有什么问题? – Deamon