Fix npm run start to run everything.

We can run the project locally with a single command now.
This commit is contained in:
antanst 2025-08-09 16:59:17 +03:00
parent 27d41aaeed
commit 7035ad3691
2 changed files with 23 additions and 1 deletions

View file

@ -7,7 +7,7 @@
"test": "test"
},
"scripts": {
"start": "npm run backend:start",
"start": "bash scripts/start-all-dev.sh",
"dev": "npm run frontend:dev",
"build": "npm run frontend:build",
"test": "npm run backend:test",

22
scripts/start-all-dev.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
cleanup() {
echo
echo "Stopping frontend and backend..."
local pids
pids="$(jobs -p || true)"
if [ -n "$pids" ]; then
kill $pids 2>/dev/null || true
wait $pids 2>/dev/null || true
fi
}
trap cleanup INT TERM EXIT
echo "Starting backend..."
npm run backend:start &
echo "Starting frontend..."
npm run frontend:dev &
wait