make API url dynamic

This commit is contained in:
Sean Macfarlane
2020-08-03 12:03:56 -04:00
parent c001ce21ba
commit dc8374300e
6 changed files with 21 additions and 4 deletions

10
generate_config_js.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/sh -eu
if [ -z "${API:-}" ]; then
API_URL_JSON=undefined
else
API_URL_JSON=$(jq -n --arg api '$API' '$api')
fi
cat <<EOF
window.REACT_APP_API=$API_URL_JSON;
EOF