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