-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathstart-api.sh
More file actions
33 lines (26 loc) · 931 Bytes
/
start-api.sh
File metadata and controls
33 lines (26 loc) · 931 Bytes
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
# Start script for PathRAG API only
# Colors for terminal output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting PathRAG API...${NC}"
# Check if Python virtual environment exists
if [ ! -d ".venv" ]; then
echo -e "${YELLOW}Python virtual environment not found. Creating one...${NC}"
python -m venv .venv
echo -e "${GREEN}Virtual environment created.${NC}"
fi
# Activate virtual environment
echo -e "${BLUE}Activating Python virtual environment...${NC}"
source .venv/bin/activate
# Install backend dependencies
echo -e "${BLUE}Installing backend dependencies...${NC}"
pip install -r requirements.txt
echo -e "${GREEN}Backend dependencies installed.${NC}"
# Start backend API
echo -e "${BLUE}Starting backend API on port 8000...${NC}"
cd "$(dirname "$0")"
uvicorn main:app --host 0.0.0.0 --port 8000
echo -e "${GREEN}API server stopped.${NC}"