You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
706 B

9 years ago
9 years ago
  1. #! /bin/sh
  2. set -e
  3. if [ "$API_KEY" != "**None**" ]; then
  4. sed -i "s|/\*||g" index.html
  5. sed -i "s|\*/||g" index.html
  6. sed -i "s|myApiKeyXXXX123456789|$API_KEY|g" index.html
  7. fi
  8. if [[ -f $SWAGGER_JSON ]]; then
  9. sed -i "s|http://petstore.swagger.io/v2/swagger.json|swagger.json|g" index.html
  10. sed -i "s|http://example.com/api|swagger.json|g" index.html
  11. else
  12. sed -i "s|http://petstore.swagger.io/v2/swagger.json|$API_URL|g" index.html
  13. sed -i "s|http://example.com/api|$API_URL|g" index.html
  14. fi
  15. if [[ -n "$VALIDATOR_URL" ]]; then
  16. sed -i "s|.*validatorUrl:.*$||g" index.html
  17. sed -i "s|\(url: url,.*\)|\1\n validatorUrl: \"${VALIDATOR_URL}\",|g" index.html
  18. fi
  19. exec http-server -p $PORT $*