Download src/app/api/memory/engine-status/route.ts from rais133/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/app/api/memory/engine-status/route.ts
- Command line
-
hf download hf://spaces/rais133/omniroute/src/app/api/memory/engine-status/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/app/api/memory/engine-status/route.ts
684 Bytes
| import { NextResponse } from "next/server"; | |
| import { isAuthenticated } from "@/shared/utils/apiAuth"; | |
| import { engineStatus } from "@/lib/memory/retrieval"; | |
| import { sanitizeErrorMessage } from "@omniroute/open-sse/utils/error.ts"; | |
| export async function GET(request: Request) { | |
| if (!(await isAuthenticated(request))) { | |
| return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); | |
| } | |
| try { | |
| const status = await engineStatus(); | |
| return NextResponse.json(status); | |
| } catch (err: unknown) { | |
| const message = sanitizeErrorMessage(err instanceof Error ? err.message : String(err)); | |
| return NextResponse.json({ error: { message } }, { status: 500 }); | |
| } | |
| } | |