至关于为目的地设置一个详细地址node
至关于规划一个从起始点到终点站的地图express
至关于开启代理https服务,在SSL Proxy配置下的host才容许在本地经过https访问请求或接受请求。api
思想:服务器
import * as express from 'express'; import { createProxyMiddleware, Filter, Options, RequestHandler } from 'http-proxy-middleware'; const app = express(); app.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true })); app.listen(3000); // http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar
node 中app
// proxy api requests Object.keys(proxyTable).forEach(function (context) { var options = proxyTable\[context\] if (typeof options === 'string') { options = { target: options } } app.use(proxyMiddleware(options.filter || context, options)) })
proxyTable 配置无效
proxTabtle 配置错误,好比:pathRewrite中配置 和前端接口请求中url写法不匹配或是接口请求中写死了host,因此不走代理。
其余可能性参考:Vue-cli proxyTable 配置无效问题post
未完待续。url