Skip to content

Instantly share code, notes, and snippets.

@toefel18
Created December 7, 2020 17:56
Show Gist options
  • Save toefel18/17e13837fc528048b4e62812205a47d1 to your computer and use it in GitHub Desktop.
Save toefel18/17e13837fc528048b4e62812205a47d1 to your computer and use it in GitHub Desktop.
if [ -e $FILE ];
then
echo "Usage:"
echo "FILE=https://some/location/swagger.yml ./run-swagger-ui.sh"
exit 1
fi
curl -s -o swagger.yml $FILE
echo visit http://localhost:8080 rendering docs of $FILE
echo ctrl + c to stop
docker run --rm --mount "type=bind,source=$(pwd)/swagger.yml,target=/usr/share/nginx/html/swagger.yml" -it -p 8080:8080 -e "SWAGGER_JSON_URL=http://localhost:8080/swagger.yml" swaggerapi/swagger-ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment