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>
This commit is contained in:
13
maternal-web/app/api/health/route.ts
Normal file
13
maternal-web/app/api/health/route.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user