Deploy: fix /api/health + deploy script Next.js detection
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

This commit is contained in:
2025-12-15 14:09:38 +01:00
parent bb7ce97330
commit c16afe468f
2 changed files with 19 additions and 3 deletions

View File

@ -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

View File

@ -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