如题,在本地起了个端口3000
的react服务器,和一个端口8090
的json-server
。我想把localhost:3000/api/这样的请求都导向到json-server
上面,在webpack-dev-server
中设置了proxy
proxy: {
'/api': {
target: 'http://localhost:8090',
secure: false
}
}
但每次访问的时候react-router
总是提示Warning: [react-router] Location "/api" did not match any routes
并没有将api
的请求导向到http://localhost:8090
上去
是proxy
配置有问题还是react-router
没处理好呢?有人遇到这个问题吗?