Use react-scripts proxy for development

Setting the `defaultDevConfig.url` to use the default port and
proxying requests via the react-scripts proxy overcomes CORS issues
and reduces friction for ui contributions
This commit is contained in:
Yasa Akbulut 2020-03-12 23:43:40 +01:00 committed by Jannis Mattheis
parent 66ae74f830
commit ce056faed8
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
"version": "0.2.0", "version": "0.2.0",
"private": true, "private": true,
"homepage": ".", "homepage": ".",
"proxy": "http://localhost:80",
"dependencies": { "dependencies": {
"@material-ui/core": "^4.4.3", "@material-ui/core": "^4.4.3",
"@material-ui/icons": "^4.4.3", "@material-ui/icons": "^4.4.3",

View File

@ -17,7 +17,7 @@ import {PluginStore} from './plugin/PluginStore';
import {registerReactions} from './reactions'; import {registerReactions} from './reactions';
const defaultDevConfig = { const defaultDevConfig = {
url: 'http://localhost:80/', url: 'http://localhost:3000/',
}; };
const {port, hostname, protocol, pathname} = window.location; const {port, hostname, protocol, pathname} = window.location;