Files
maternal-app/maternal-web/app/api/health/route.ts
Andrei 78aef1d918
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled
feat: Add health check endpoint for network status detection
Created /api/health endpoint that returns 200 OK to allow Redux
network detection middleware to properly check connectivity status.

Without this endpoint, the app was showing as offline even when
connected to the internet.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 19:44:42 +00:00

14 lines
350 B
TypeScript

import { NextResponse } from 'next/server';
/**
* Health check endpoint for network status detection
* Returns 200 OK when the app is reachable
*/
export async function GET() {
return NextResponse.json({ status: 'ok', timestamp: new Date().toISOString() });
}
export async function HEAD() {
return new NextResponse(null, { status: 200 });
}