Swagger-ui local setup issue

半腔热情 提交于 2019-12-12 13:33:52

问题


I am trying to do local setup of swagger-ui, i am following this link Swagger-ui and following the instruction given in how to use it, i have download its zip file, installed nodejs package and tried to run the following commands mentioned there in the link,

1. npm Install 
2. gulp

but as i run npm install it gives me error which is[ Error Screen Shot 1 ]

can you guide me how i can complete swagger-ui local environment setup. by following above mentioned link.


回答1:


There is really no reason to download and rebuild swagger-ui. It's probably easiest to grab one of the releases and run it in an http server:

  1. Download https://github.com/swagger-api/swagger-ui/archive/v2.1.4.zip
  2. unzip v2.1.4.zip
  3. cd swagger-ui-2.1.4\dist
  4. http-server .

This assumes you have installed http-server:

npm install -g http-server

then you can access swagger-ui at http://localhost:8080




回答2:


If you want to use Docker I found this pre-built image works well:

docker run -d --name swagguer-ui -p 8888:8888 sjeandeaux/docker-swagger-ui

Or with your own default API URL:

docker run -d --name swagger-ui -p 8888:8888 -e "API_URL=YOUR_URL" sjeandeaux/docker-swagger-ui


来源:https://stackoverflow.com/questions/34898290/swagger-ui-local-setup-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!