From aef1c4efaa636cba648eb7a0eb525acc1db487a7 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Tue, 21 Jan 2025 22:30:23 +0530 Subject: redirect /files/ also --- blocks/install.sh | 18 +++++++++++------- blocks/run.sh | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/blocks/install.sh b/blocks/install.sh index ec9af85d..57d5a14a 100755 --- a/blocks/install.sh +++ b/blocks/install.sh @@ -14,10 +14,10 @@ python manage.py migrate -v0 python manage.py loaddata -v0 xcosblocks sed -i \ - -e "s/\\(SCILAB_DIR = \\).*/\\1'\/usr\/local'/" \ - -e "s/\\(CELERY_BROKER_URL = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ - -e "s/\\(CELERY_RESULT_BACKEND = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ - blocks/settings.py + -e "s/\\(SCILAB_DIR = \\).*/\\1'\/usr\/local'/" \ + -e "s/\\(CELERY_BROKER_URL = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ + -e "s/\\(CELERY_RESULT_BACKEND = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ + blocks/settings.py sed -i -e '/^\s*location \/ {/,/^\s*}/c\ location / {\ @@ -33,6 +33,10 @@ sed -i -e '/^\s*location \/ {/,/^\s*}/c\ location /django_static/ {\ proxy_pass http://127.0.0.1:8000;\ }\ +\ + location /files/ {\ + proxy_pass http://127.0.0.1:8000;\ + }\ \ location /resources/ {\ proxy_pass http://127.0.0.1:3500;\ @@ -51,10 +55,10 @@ sed -i -e '/^\s*location \/ {/,/^\s*}/c\ cd eda-frontend if test "$1" = 'prod'; then - npm install -g serve + npm install -g serve fi npm install --silent if test "$1" = 'prod'; then - npm run build - rm -rf node_modules public src + npm run build + rm -rf node_modules public src fi diff --git a/blocks/run.sh b/blocks/run.sh index 02e6e55c..2266ddde 100755 --- a/blocks/run.sh +++ b/blocks/run.sh @@ -10,9 +10,9 @@ celery -A blocks.celery_tasks worker --loglevel INFO --concurrency 1 & cd eda-frontend if test "$1" = 'prod'; then - serve -l 3500 -n -s --no-port-switching build & + serve -l 3500 -n -s --no-port-switching build & else - npm start & + npm start & fi cd .. -- cgit