Reputation: 11
I have installed react-app-rewired. In the package.json I have set
"scripts": {
"start": "react-app-rewired start --scripts-version react-scripts",
}
When I run
npm start
It opens a browser window on localhost:3000 I would like to open it to a specific URL:port that I have set in my hosts file. This will allow my local front end app to contact a remote API without throwing a CORS issue.
Upvotes: 1
Views: 1064
Reputation: 3654
this is webpack-dev-server related
module.exports = {
//...
devServer: {
open: ['/my-page'],
},
};
https://webpack.js.org/configuration/dev-server/#devserveropen
// config-overrides.js
module.exports = () => ({
devServer: (c) => {
return () => ({open: ['/newer-url']});
}
});
Upvotes: 1