-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.sh
More file actions
executable file
Β·54 lines (46 loc) Β· 1.71 KB
/
start_server.sh
File metadata and controls
executable file
Β·54 lines (46 loc) Β· 1.71 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Agentic Coder Server Startup Script
# Starts the FastAPI server accessible from external machines
set -e
echo "π Starting Agentic Coder Server..."
echo ""
# Check if .env exists
if [ ! -f .env ]; then
echo "β οΈ Warning: .env file not found"
echo " Creating from .env.example..."
if [ -f .env.example ]; then
cp .env.example .env
echo "β Created .env - Please edit it with your configuration"
echo ""
else
echo "β Error: .env.example not found"
exit 1
fi
fi
# Check if virtual environment exists
if [ -d "venv" ]; then
echo "π¦ Activating virtual environment..."
source venv/bin/activate
fi
# Install dependencies if needed
if ! python -c "import fastapi" 2>/dev/null; then
echo "π₯ Installing dependencies..."
pip install -r requirements.txt
fi
# Get local IP address for display
LOCAL_IP=$(hostname -I | awk '{print $1}' 2>/dev/null || echo "unknown")
echo ""
echo "β
Server Configuration:"
echo " - Local access: http://localhost:8000"
echo " - Network access: http://${LOCAL_IP}:8000"
echo " - API docs: http://localhost:8000/docs"
echo " - Health check: http://localhost:8000/health"
echo ""
echo "π Server will be accessible from other machines on your network"
echo " Use this for remote client: ${LOCAL_IP}:8000"
echo ""
echo "Press Ctrl+C to stop the server"
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo ""
# Start server with external access enabled
cd backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload