http-proxy-middleware是一站式node.jshttp-proxy中间件,用于连接、表达和浏览器同步。
安装
$ npm install --save-dev http-proxy-middleware配置
var proxyMiddleware = require('http-proxy-middleware');var proxy = proxyMiddleware('/api', {target: 'https://www.example.org'});// \____/ \________________________________/// | |// context options// 'proxy' is now ready to be used in a server.
评论