-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_webui.sh
More file actions
executable file
·31 lines (25 loc) · 818 Bytes
/
start_webui.sh
File metadata and controls
executable file
·31 lines (25 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Start the Library Management Web UI (Unix/Linux/macOS)
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
source .venv/bin/activate
fi
# Load environment variables if .env exists
if [ -f ".env" ]; then
export $(grep -v '^#' .env | xargs)
fi
# Get host and port from environment or use defaults
HOST=${HOST:-127.0.0.1}
PORT=${PORT:-8000}
echo "Starting Library Management Web UI..."
echo "API will be available at: http://${HOST}:${PORT}"
echo "Open index.html in your browser to use the Web UI"
echo
# Try to open the browser (works on most systems)
if command -v xdg-open &> /dev/null; then
xdg-open index.html 2>/dev/null &
elif command -v open &> /dev/null; then
open index.html &
fi
# Start the API server
uvicorn api:app --host "$HOST" --port "$PORT" --reload