ente/src/pages/api/[...all].ts

16 lines
357 B
TypeScript
Raw Normal View History

import { createProxyMiddleware } from 'http-proxy-middleware';
export const config = {
2020-10-01 11:51:36 +00:00
api: {
bodyParser: false,
},
};
2020-10-01 11:51:36 +00:00
const API_ENDPOINT = process.env.NEXT_PUBLIC_ENTE_ENDPOINT || "https://api.staging.ente.io";
2020-09-14 09:32:01 +00:00
export default createProxyMiddleware({
2020-10-01 11:51:36 +00:00
target: API_ENDPOINT,
changeOrigin: true,
pathRewrite: { '^/api': '/' },
});