159b175774
- Dedicated proxy routes for sessions, messages, search, memory, config - Removes [...path] catch-all that conflicted with specific routes - Session detail + delete proxy - Custom 404 page matching design system
18 lines
552 B
TypeScript
18 lines
552 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
|
|
const BACKEND = process.env.HERMES_BACKEND_URL || "http://127.0.0.1:8643";
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const qs = req.nextUrl.search;
|
|
try {
|
|
const res = await fetch(BACKEND + "/api/sessions/search" + qs);
|
|
const data = await res.text();
|
|
return new NextResponse(data, {
|
|
status: res.status,
|
|
headers: { "content-type": "application/json" },
|
|
});
|
|
} catch {
|
|
return NextResponse.json({ query: "", count: 0, results: [] }, { status: 502 });
|
|
}
|
|
}
|