标签:geo 前后端分离 -- get virt local 反向 nodejs nod
npm install http-proxy-middleware --save
// 1. 引入http-proxy-middleware模块
var proxy = require(‘http-proxy-middleware‘);
// 2. 代理中间件配置项
var options = {
target: ‘http://192.168.182.66:8080/‘, // target host
changeOrigin: true, // needed for virtual hosted sites
};
// 3. 将请求路径按“代理中间件配置项”进行请求
app.use(proxy(‘/login/*‘,options));
标签:geo 前后端分离 -- get virt local 反向 nodejs nod
原文地址:https://www.cnblogs.com/zero-zm/p/10014664.html