0
点赞
收藏
分享

微信扫一扫

http-proxy-middleware做代理时,自定义复杂的匹配规则

左手梦圆 2022-07-01 阅读 46

 

/**
* @return {Boolean}
*/
const filter = function (pathname, req) {
return pathname.match('^/api') && req.method === 'GET';
};

const apiProxy = createProxyMiddleware(filter, {
target: 'http://www.example.org',
});


举报

相关推荐

0 条评论