From 710ff8c8552a738cf03feeefcfb16e5941a11ab7 Mon Sep 17 00:00:00 2001 From: MarkLo Date: Fri, 21 Nov 2025 10:17:55 +0800 Subject: [PATCH] --- frontend/lib/api.ts | 3 --- frontend/next.config.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/lib/api.ts b/frontend/lib/api.ts index 4a549939..e7720a25 100644 --- a/frontend/lib/api.ts +++ b/frontend/lib/api.ts @@ -10,10 +10,7 @@ import type { Ticker, } from "./types"; -const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"; - const apiClient = axios.create({ - baseURL: API_URL, headers: { "Content-Type": "application/json", }, diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 66e15661..2427d3c5 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -3,6 +3,16 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ reactCompiler: true, + async rewrites() { + return [ + { + source: "/api/:path*", + destination: `${ + process.env.API_URL || "http://backend:8000" + }/api/:path*`, + }, + ]; + }, }; export default nextConfig;