Spaces:
Runtime error
Runtime error
File size: 811 Bytes
054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a 69f2236 054d73a | 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 32 33 | #!/bin/bash
# Run the ExamInsight backend server
set -e
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BACKEND_DIR="$(dirname "$SCRIPT_DIR")"
cd "$BACKEND_DIR"
# Load environment variables from .env if it exists
if [ -f "../.env" ]; then
export $(cat ../.env | grep -v '^#' | xargs)
fi
# Check if we're in a virtual environment, create one if not
if [ -z "$VIRTUAL_ENV" ]; then
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
python3 -m venv .venv
fi
source .venv/bin/activate
fi
# Install dependencies
echo "Installing dependencies..."
pip install -q -e .
# Run the server
echo "Starting ExamInsight backend on http://127.0.0.1:8000"
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload
|