From 78aef1d918fe7d3d4b38ddd54e6b13ff2b79009b Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 1 Oct 2025 19:44:42 +0000 Subject: [PATCH] feat: Add health check endpoint for network status detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- maternal-web/app/api/health/route.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 maternal-web/app/api/health/route.ts diff --git a/maternal-web/app/api/health/route.ts b/maternal-web/app/api/health/route.ts new file mode 100644 index 0000000..73ccb77 --- /dev/null +++ b/maternal-web/app/api/health/route.ts @@ -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 }); +}