refactor: rename web/ to api/ to better reflect its purpose
Some checks failed
Deploy to Production / test (push) Failing after 30s
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>
This commit is contained in:
36
api/src/routes/health.routes.ts
Normal file
36
api/src/routes/health.routes.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @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
|
||||
};
|
||||
Reference in New Issue
Block a user