ente/src/pages/api/[...all].ts
2021-02-09 15:04:10 +05:30

17 lines
363 B
TypeScript

import { createProxyMiddleware } from 'http-proxy-middleware';
export const config = {
api: {
bodyParser: false,
},
};
const API_ENDPOINT =
process.env.NEXT_PUBLIC_ENTE_ENDPOINT || 'https://api.staging.ente.io';
export default createProxyMiddleware({
target: API_ENDPOINT,
changeOrigin: true,
pathRewrite: { '^/api': '/' },
});