update server helper

This commit is contained in:
ben
2026-08-17 12:28:54 +02:00
parent 6cc1f71a85
commit f43c32c72b
2 changed files with 39 additions and 2 deletions
+33 -2
View File
@@ -1,14 +1,45 @@
#!/bin/bash
set -e
VENV=""
for dir in .venv venv env; do
if [ -f "$dir/bin/activate" ]; then
VENV="$dir"
break
fi
done
if [ -z "$VENV" ]; then
echo "ERROR: No virtual environment found."
echo "Expected .venv/, venv/ or env/"
exit 1
fi
echo "Using virtual environment: $VENV"
source "$VENV/bin/activate"
if [ ! -f requirements.txt ]; then
echo "ERROR: requirements.txt not found."
exit 1
fi
echo "Checking requirements..."
python -m pip install -r requirements.txt
case "$1" in
local)
echo "Starting Calendar API locally..."
python3 -m uvicorn main:app --reload
python -m uvicorn main:app --reload
;;
lan)
echo "Starting Calendar API on LAN..."
python3 -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload
;;
*)
echo "Usage: $0 {local|lan}"
echo " local Start locally"