src / setupProxy.js create a file
const proxy = require('http-proxy-middleware'); module.exports = function(app) { app.use(proxy('/api', { target: 'https://www.easy-mock.com/api/' , secure: false, changeOrigin: true, pathRewrite: { "^/api": "/" }, // http://www.easy-mock.com' // cookieDomainRewrite: "http://localhost:3000" })); };
if not
package.json
Add to
"proxy":"http://youAddr.com"
If not enough
Add to
"proxy":{ "/rank/**":{ "target":"http://m.kugou.com", "changeOrigin": true } }