Some checks failed
Deploy to Production / test (push) Failing after 30s
The web/ folder contains the REST API, WebSocket server, and OAuth routes — not a web frontend. Renaming to api/ clarifies this distinction since the actual web frontend lives in panel/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
846 B
TypeScript
37 lines
846 B
TypeScript
/**
|
|
* @fileoverview Health check endpoint for Aurora API.
|
|
* Provides a simple health status endpoint for monitoring and load balancers.
|
|
*/
|
|
|
|
import type { RouteContext, RouteModule } from "./types";
|
|
|
|
/**
|
|
* Health routes handler.
|
|
*
|
|
* @route GET /api/health
|
|
* @description Returns server health status with timestamp.
|
|
* @response 200 - `{ status: "ok", timestamp: number }`
|
|
*
|
|
* @example
|
|
* // Request
|
|
* GET /api/health
|
|
*
|
|
* // Response
|
|
* { "status": "ok", "timestamp": 1707408000000 }
|
|
*/
|
|
async function handler(ctx: RouteContext): Promise<Response | null> {
|
|
if (ctx.pathname === "/api/health" && ctx.method === "GET") {
|
|
return Response.json({
|
|
status: "ok",
|
|
timestamp: Date.now()
|
|
});
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
export const healthRoutes: RouteModule = {
|
|
name: "health",
|
|
handler
|
|
};
|