New session creation page, + button on History

- /history/new: compose first message, creates web session, sends, redirects
- POST /api/sessions proxy route
- History page gets + button in header
This commit is contained in:
Hermes
2026-04-09 21:18:50 -05:00
parent 9994bbeaac
commit a5f63e8aba
3 changed files with 109 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
import { NextRequest, NextResponse } from "next/server";
const BACKEND = process.env.HERMES_BACKEND_URL || "http://127.0.0.1:8643";
export async function POST(req: NextRequest) {
const body = await req.text();
try {
const res = await fetch(BACKEND + "/api/sessions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body,
});
const data = await res.text();
return new NextResponse(data, {
status: res.status,
headers: { "content-type": "application/json" },
});
} catch {
return NextResponse.json({ error: "backend unreachable" }, { status: 502 });
}
}