blob: b74fefa2adb3f0f15f8783786199db191259a4d1 [file] [log] [blame]
import getConfig from "next/config";
import { createProxyMiddleware } from "http-proxy-middleware";
const { serverRuntimeConfig } = getConfig();
const apiProxy = createProxyMiddleware({
target: serverRuntimeConfig.SERVER_URL,
changeOrigin: true,
pathRewrite: { [`^/api`]: "" },
});
export default function (req, res) {
apiProxy(req, res);
}
export const config = { api: { externalResolver: true, bodyParser: false } };