icynet-admin/server/proxy.ts

12 lines
373 B
TypeScript
Raw Permalink Normal View History

2022-08-29 18:09:28 +00:00
import httpProxy from 'http-proxy';
export const proxy = httpProxy.createProxyServer({
/**
* Get the actual back-end service url from env variables.
* We shouldn't prefix the env variable with NEXT_PUBLIC_* to avoid exposing it to the client.
*/
2022-09-11 09:44:43 +00:00
changeOrigin: process.env.NODE_ENV === 'production',
2022-08-29 18:09:28 +00:00
target: process.env.SERVER_URL,
autoRewrite: false,
});