Files
PromptTech/scripts/start_backend.sh

21 lines
581 B
Bash
Raw Permalink Normal View History

2026-01-27 18:07:00 -06:00
#!/bin/bash
# Backend Startup Script with Error Handling
echo "🚀 Starting Backend Server..."
cd /media/pts/Website/PromptTech_Solution_Site/backend
# Activate virtual environment
source venv/bin/activate
# Kill any existing processes on port 8181
echo "Checking for existing processes..."
lsof -ti:8181 | xargs kill -9 2>/dev/null || true
sleep 1
# Start the backend
echo "Starting Uvicorn server on port 8181..."
uvicorn server:app --reload --host 0.0.0.0 --port 8181
# If interrupted, this will clean up
trap 'echo "⚠️ Backend stopped"; deactivate; exit 0' INT TERM