Proxy API through Next.js route handlers — eliminates CORS

This commit is contained in:
Hermes
2026-04-09 20:54:13 -05:00
parent 517583d1c4
commit 1bce2a29cc
6 changed files with 81 additions and 3 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
const BASE = process.env.NEXT_PUBLIC_HERMES_API || "http://localhost:8787";
const BASE = "";
async function get<T>(path: string): Promise<T> {
const res = await fetch(`${BASE}${path}`);
@@ -85,4 +85,4 @@ export const fetchSkill = (name: string) =>
export const fetchConfig = () => get<ConfigResponse>("/api/config");
// Health
export const fetchHealth = () => get<{ status: string }>("/api/health");
export const fetchHealth = () => get<{ status: string }>("/health");