/**
 * Health Check Handler
 */

import { defineApiRoutes } from './define.js';
import { apiSuccess } from './respond.js';

async function handleHealth() {
  // Return only a liveness signal. Process uptime and version strings are
  // operational fingerprinting data; exposing them unauthenticated aids
  // attackers in timing restarts and targeting known-vulnerable versions.
  return apiSuccess({
    status: 'ok',
    timestamp: new Date().toISOString()
  });
}

export const routes = defineApiRoutes([
  { path: '/health', method: 'GET', handler: handleHealth, auth: 'public', skipRateLimit: true }
]);
