const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { app.use( '/home', createProxyMiddleware({ // 目标地址 target: 'https://home-api.pinduoduo.com', // 修改原地址 changeOrigin: true, }) ); app.use( '/api',createProxyMiddleware({ target: 'http://api.bdplus.cn/', changeOrigin: true, }) ); };