14 lines
270 B
TypeScript
14 lines
270 B
TypeScript
const apiMap = {};
|
|
|
|
export function getLocalApiProxy() {
|
|
for (const key in apiMap) {
|
|
apiMap[key] = {
|
|
target: apiMap[key],
|
|
ws: true,
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(new RegExp('^' + key), ''),
|
|
};
|
|
}
|
|
return apiMap;
|
|
}
|