fix: proxy api via Next.js rewrites, no external API URL needed

This commit is contained in:
root 2026-02-26 12:14:49 +00:00
parent be64df99a2
commit 05c9428fad
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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;