Proxy API through Next.js route handlers — eliminates CORS
This commit is contained in:
+2
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user