This commit is contained in:
Dennis Postma 2025-02-09 03:26:36 +01:00
parent 51cbe87755
commit f50e4c75a9

View File

@ -46,19 +46,8 @@ stop_server() {
start_server() { start_server() {
if ! is_server_running; then if ! is_server_running; then
log "Starting Node server..." log "Starting Node server..."
# Start the server in foreground # Run npm start directly in foreground
npm run start & npm run start
NODE_PID=$!
sleep 2 # Wait for the server to start
if is_server_running; then
log "Node server started successfully"
# Bring the process to foreground
fg %1
else
log "ERROR: Failed to start Node server"
exit 1
fi
else else
log "Node server is already running" log "Node server is already running"
fi fi
@ -92,7 +81,3 @@ log "Database migrations completed successfully"
# Start the server # Start the server
start_server start_server
# Monitor server and restart if it stops
log "Server started. You can now interact with the Node.js console."
wait $NODE_PID