问题
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:
- Download https://github.com/swagger-api/swagger-ui/archive/v2.1.4.zip
- unzip v2.1.4.zip
- cd swagger-ui-2.1.4\dist
- 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