Reference · Snippet · typescript

RAG health check route

Last updated

nextjsragdeploy

// app/api/health/route.ts
export async function GET() {
  try {
    // ping vector store + optional embed smoke test
    await vectorClient.ping();
    return Response.json({ ok: true });
  } catch (e) {
    return Response.json({ ok: false, error: String(e) }, { status: 503 });
  }
}