diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-07-25 16:20:17 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-07-25 16:20:17 +1000 |
| commit | b342aaa031eabecb6273afa3c948adcd05006e7e (patch) | |
| tree | c40d3698bb2e85bd1e1ae26a7f8aee72e65f49c0 | |
| parent | 6ce828cb9649e8fc0a68bd7f0f99719b73229692 (diff) | |
Fix post-deployment CORS issue when requesting from www.*
| -rwxr-xr-x | prebuild.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prebuild.sh b/prebuild.sh index 1e2a268..5f348c1 100755 --- a/prebuild.sh +++ b/prebuild.sh @@ -2,6 +2,6 @@ set -e sed -i -e "s|base: .*,|base: '/tilo/',|" vite.config.js -sed -i -e "s|SERVER_DATA_URL = .*|SERVER_DATA_URL = 'https://terryt.dev/tilo/data'|" \ +sed -i -e "s|SERVER_DATA_URL = .*|SERVER_DATA_URL = (new URL(window.location.href)).origin + '/tilo/data/'|" \ -e "s|SERVER_IMG_PATH = .*|SERVER_IMG_PATH = '/img/tilo/'|" src/lib.ts sed -i -e 's|dbFile = .*|dbFile = "/usr/local/www/db/tilo.db"|' backend/tilo.py |
