From 05c9428fad13330d484495c388bb0a8e6df8415e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Feb 2026 12:14:49 +0000 Subject: [PATCH] fix: proxy api via Next.js rewrites, no external API URL needed --- frontend/lib/api.ts | 2 +- frontend/next.config.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/lib/api.ts b/frontend/lib/api.ts index 51eeb07..5781ef9 100644 --- a/frontend/lib/api.ts +++ b/frontend/lib/api.ts @@ -1,4 +1,4 @@ -const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:4330"; +const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? ""; export interface RateData { symbol: string; diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e9ffa30..f649806 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,14 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + async rewrites() { + return [ + { + source: "/api/:path*", + destination: "http://127.0.0.1:4332/api/:path*", + }, + ]; + }, }; export default nextConfig;