Files
Claude 26ece9cc9b Add library-management module: console app evolved into a Spring Boot 4 REST API
Stage 2 console classes and the shared LoanPolicy, then a Spring Boot 4.1.2 + JPA API
(H2, @Version optimistic locking, problem+json errors). Tests write output/ transcripts
while asserting the same numbers; scripts regenerate everything.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4DPL6dtpFg4U4LHc2
2026-11-14 21:21:16 +05:30

14 lines
653 B
Bash
Executable File

#!/usr/bin/env bash
# Starts the REST API on :8080 (in-memory H2, so every start is a clean library).
# Usage: scripts/run.sh foreground
# scripts/run.sh --detach background, waits until /api/books answers
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -B -q -DskipTests package
if [ "${1:-}" = "--detach" ]; then
setsid nohup java -jar target/library-management-1.0.0.jar > /tmp/library-api.log 2>&1 < /dev/null &
for _ in $(seq 1 60); do curl -s -o /dev/null localhost:8080/api/books && exit 0; sleep 1; done
echo "API did not start; see /tmp/library-api.log" >&2; exit 1
fi
exec java -jar target/library-management-1.0.0.jar