import { Express } from 'express' ; import type { Config } from 'http-proxy-middleware' ; export const setupProxy = async ( app , proxyConfig , dev ) => { if ( ! proxyConfig || ! dev ) { return ; } const { default : createProxyMiddleware } = await import ( 'http-proxy-middleware' ) ; Object . keys ( proxyConfig ) . forEach ( ( context ) => { app . use ( createProxyMiddleware ( context , proxyConfig [ context ] ) ) ; } ) ; } ;