ForcePilot/scripts/run.sh

23 lines
455 B
Bash
Raw Normal View History

2024-07-14 16:42:38 +08:00
#!/bin/bash
# Function to stop the services
stop_services() {
echo "Stopping services..."
pkill -f "npm run server"
2024-10-08 22:16:17 +08:00
pkill -f "uvicorn src.main:app --host 0.0.0.0 --port 5000 --reload"
2024-07-14 16:42:38 +08:00
exit
}
# Trap signals to stop services
trap stop_services SIGINT SIGTERM
2024-07-26 14:13:15 +08:00
# Start the server
2024-10-08 22:16:17 +08:00
uvicorn src.main:app --host 0.0.0.0 --port 5000 --reload &
2024-07-26 14:13:15 +08:00
2024-07-14 16:42:38 +08:00
# Start the frontend service
cd web
2024-07-14 16:42:38 +08:00
npm run server &
# Wait for all background jobs to finish
wait