Reactjs 网页包开发服务器重定向到URL
我正在使用React和Webpack。该应用程序由Reactjs 网页包开发服务器重定向到URL,reactjs,webpack,webpack-dev-server,Reactjs,Webpack,Webpack Dev Server,我正在使用React和Webpack。该应用程序由localhost:3000提供。我想使用Webpack服务器从路径localhost:3000/某些路由重定向到localhost:3001 我尝试了以下代码: devServer: { proxy: { 'some-route': { changeOrigin: true, secure: false, target: 'http://localhost:3001', } }
localhost:3000
提供。我想使用Webpack服务器从路径localhost:3000/某些路由
重定向到localhost:3001
我尝试了以下代码:
devServer: {
proxy: {
'some-route': {
changeOrigin: true,
secure: false,
target: 'http://localhost:3001',
}
}
}
但它不起作用。如何获得此功能