Browse Source

Add ability to override Swagger valdiatorUrl property

pull/36/head
kevi6083 8 years ago
parent
commit
bbe438f473
  1. 1
      swagger-ui/README.md
  2. 4
      swagger-ui/run.sh

1
swagger-ui/README.md

@ -13,3 +13,4 @@ $ docker run -d -p 80:80 -e API_URL=http://localhost:4000/swagger schickling/swa
* `API_URL` - Swagger endpoint for your API * `API_URL` - Swagger endpoint for your API
* `API_KEY` - Default API Key (optional) * `API_KEY` - Default API Key (optional)
* `PORT` - Default port to run on (optional) * `PORT` - Default port to run on (optional)
* `VALIDATOR_URL` - Swagger validator (optional)

4
swagger-ui/run.sh

@ -16,4 +16,8 @@ else
sed -i "s|http://example.com/api|$API_URL|g" index.html sed -i "s|http://example.com/api|$API_URL|g" index.html
fi fi
if [[ -n "$VALIDATOR_URL" ]]; then
sed -i "s|url: url,.*|url: url, validatorUrl: \"${VALIDATOR_URL}\",|g" index.html
fi
exec http-server -p $PORT $* exec http-server -p $PORT $*
Loading…
Cancel
Save