diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e9ffa30..fa6156f 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:8000/api/:path*', + }, + ] + }, }; export default nextConfig; diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index d19afdd..2806917 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -1,4 +1,4 @@ -const API_BASE = "http://localhost:8000/api"; +const API_BASE = "/api"; export async function searchStock(query: string) { const res = await fetch(`${API_BASE}/search`, {