proxy.js 274 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 export function createProxy(prefix, target) { const ret = {}; ret[prefix] = { target, changeOrigin: true, ws: true, // rewrite: (path) => path.replace(/^\/api/, '') // rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''), } return ret }