21 lines
535 B
Bash
Executable File
21 lines
535 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
FRONTEND_PORT="${PORT:-3000}"
|
|
BACKEND_PORT="${BACKEND_PORT:-3001}"
|
|
export SERVE_FRONTEND="${SERVE_FRONTEND:-false}"
|
|
export API_PROXY_TARGET="${API_PROXY_TARGET:-http://127.0.0.1:${BACKEND_PORT}}"
|
|
export NEXT_TELEMETRY_DISABLED=1
|
|
|
|
cleanup() {
|
|
if [[ -n "${BACKEND_PID:-}" ]]; then
|
|
kill "${BACKEND_PID}" 2>/dev/null || true
|
|
fi
|
|
}
|
|
trap cleanup EXIT INT TERM
|
|
|
|
PORT="${BACKEND_PORT}" npm run start --workspace backend &
|
|
BACKEND_PID=$!
|
|
|
|
PORT="${FRONTEND_PORT}" npm run start --workspace frontend
|