@leafage/server
Version:
The React Server Side Render Framework
22 lines (19 loc) • 529 B
JavaScript
/**
* @leafage/server v1.3.2
*
* Copyright (c) Leafage.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { createProxyMiddleware } from 'http-proxy-middleware';
var proxyPreset = function proxyPreset(ctx) {
var proxy = ctx.options.server.proxy;
if (!proxy) return;
Object.keys(proxy || {}).forEach(function (key) {
ctx.app.use(key, createProxyMiddleware(proxy[key]));
});
};
export { proxyPreset };