fix: proxy api via Next.js rewrites, no external API URL needed
This commit is contained in:
parent
be64df99a2
commit
05c9428fad
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user