Closed SoraYao closed 6 years ago
在webpack.config.dev.js中添加了代理的相关设置,但是在测试环境中每次fetch的时候 请求地址还是没有成功代理,
devServer: { historyApiFallback: true, host: 'localhost', port: '3006', hot: true, inline: true, stats: { colors: true }, proxy: { '/api/*': { target: 'http://XXXXX', pathRewrite: {'^/api' : '/api'}, changeOrigin: true } } },
可以直接设置package.json.https://github.com/yezihaohao/react-admin/issues/12#issuecomment-326169055
在webpack.config.dev.js中添加了代理的相关设置,但是在测试环境中每次fetch的时候 请求地址还是没有成功代理,
devServer: { historyApiFallback: true, host: 'localhost', port: '3006', hot: true, inline: true, stats: { colors: true }, proxy: { '/api/*': { target: 'http://XXXXX', pathRewrite: {'^/api' : '/api'}, changeOrigin: true } } },