diff --git a/backend/app/main.py b/backend/app/main.py index f203ecd..98130da 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -90,7 +90,7 @@ Login: POST /api/v1/auth/login ## Support -For API issues, contact support@pounce.ch +For API issues, contact hello@pounce.ch """, version="1.0.0", lifespan=lifespan, @@ -168,6 +168,22 @@ async def health_check(): } +@app.get("/api/health") +async def health_check_api(): + """ + Health check behind Nginx `/api` proxy. + + Nginx routes `/api/*` to the backend, so `https://pounce.ch/api/health` must exist. + """ + return await health_check() + + +@app.get("/api/v1/health") +async def health_check_api_v1(): + """Health check behind `/api/v1` prefix (convenience).""" + return await health_check() + + # Rate-limited endpoints - apply specific limits to sensitive routes from fastapi import Depends diff --git a/deploy.sh b/deploy.sh index 258d5b4..4b04f13 100755 --- a/deploy.sh +++ b/deploy.sh @@ -160,7 +160,7 @@ if ! $BACKEND_ONLY; then if [ $BUILD_EXIT -eq 0 ]; then # Gracefully restart Next.js - NEXT_PID=$(pgrep -f 'next start' | awk 'NR==1{print; exit}') + NEXT_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}') if [ -n "$NEXT_PID" ]; then echo " Restarting Next.js (PID: $NEXT_PID)..." @@ -173,7 +173,7 @@ if ! $BACKEND_ONLY; then sleep 2 # Verify - NEW_PID=$(pgrep -f 'next start' | awk 'NR==1{print; exit}') + NEW_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}') if [ -n "$NEW_PID" ]; then echo " ✓ Frontend running (PID: $NEW_PID)" else