Fix npm run start to run everything.
We can run the project locally with a single command now.
This commit is contained in:
parent
27d41aaeed
commit
7035ad3691
2 changed files with 23 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run backend:start",
|
"start": "bash scripts/start-all-dev.sh",
|
||||||
"dev": "npm run frontend:dev",
|
"dev": "npm run frontend:dev",
|
||||||
"build": "npm run frontend:build",
|
"build": "npm run frontend:build",
|
||||||
"test": "npm run backend:test",
|
"test": "npm run backend:test",
|
||||||
|
|
|
||||||
22
scripts/start-all-dev.sh
Executable file
22
scripts/start-all-dev.sh
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue