diff --git a/swagger-ui/README.md b/swagger-ui/README.md index bcba426..a1b6a75 100644 --- a/swagger-ui/README.md +++ b/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_KEY` - Default API Key (optional) * `PORT` - Default port to run on (optional) +* `VALIDATOR_URL` - Swagger validator (optional) diff --git a/swagger-ui/run.sh b/swagger-ui/run.sh index 22bca36..d507362 100644 --- a/swagger-ui/run.sh +++ b/swagger-ui/run.sh @@ -16,4 +16,9 @@ else sed -i "s|http://example.com/api|$API_URL|g" index.html fi +if [[ -n "$VALIDATOR_URL" ]]; then + sed -i "s|.*validatorUrl:.*$||g" index.html + sed -i "s|\(url: url,.*\)|\1\n validatorUrl: \"${VALIDATOR_URL}\",|g" index.html +fi + exec http-server -p $PORT $*