#!/bin/bash # HF Agent Backend Startup Script # Load environment variables from .env file if it exists if [ -f .env ]; then echo "Loading environment from .env file..." set -a source .env set +a fi # Default configuration export PORT=${PORT:-7860} export HOST=${HOST:-0.0.0.0} export CORS_ORIGINS=${CORS_ORIGINS:-*} echo "==========================================" echo "HF Agent Backend (API-only mode)" echo "==========================================" echo "Host: $HOST" echo "Port: $PORT" echo "CORS Origins: $CORS_ORIGINS" echo "==========================================" # Run the FastAPI application exec uvicorn main:app --host "$HOST" --port "$PORT" --reload