Spaces:
Running
Running
Download backend/start.sh from axeronis/microfunnel-api: direct link, hf CLI and curl.
- Browser
- Download file 651 Bytes
-
https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/start.sh
- Command line
-
hf download hf://spaces/axeronis/microfunnel-api/backend/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/axeronis/microfunnel-api/resolve/main/backend/start.sh
651 Bytes
| set -e | |
| # Logging function | |
| log() { | |
| echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1" | |
| } | |
| log "π Starting MicroFunnel Backend..." | |
| log "π Working Directory: $(pwd)" | |
| log "π€ User: $(whoami)" | |
| # 1. Run Migrations | |
| log "π οΈ Running Database Migrations..." | |
| if alembic upgrade head; then | |
| log "β Migrations applied successfully." | |
| else | |
| log "β Migration failed!" | |
| exit 1 | |
| fi | |
| # 2. Verify Port | |
| PORT="${PORT:-8000}" | |
| log "π Starting Server on 0.0.0.0:$PORT" | |
| # 3. Start Uvicorn | |
| # Use exec to replace shell process with uvicorn for signal handling | |
| exec python -m uvicorn app.main:app --host 0.0.0.0 --port "$PORT" --log-level info | |