react中proxy代理配置

http://localhost:8000/api/user => http://example.com/api/user

'/api': {
  target: 'http://example.com/',
}

http://localhost:8000/api/user => http://example.com/user

'api': {
  target: 'http://example.com/',
  pathRewrite: {
    '^/api': '',
  },
}

你可能感兴趣的:(react.js,前端,前端框架)