Shift default config to own file

This commit is contained in:
dannyrb 2019-04-29 13:29:37 -04:00
parent 0d5ac9ce4c
commit 6177a02f18
5 changed files with 41 additions and 22 deletions

14
.env.development Normal file
View File

@ -0,0 +1,14 @@
##
# DEVELOPMENT: Default
#
# We're using this to set variables for our local development.
# Please feel free to delete or modify this file for your own setup.
# Be careful not to commit anything sensitive to source control.
#
PUBLIC_URL=/
#
# Most vars require REACT_APP_* naming
#
REACT_APP_CONFIG=config/default.js

View File

@ -6,4 +6,9 @@
# environment. Be careful not to commit anything sensitive to source control.
#
PUBLIC_URL=/demo
#
# Most vars require REACT_APP_* naming
#
REACT_APP_CONFIG=config/netlify.js

View File

@ -19,7 +19,7 @@
"dev:debug": "cross-env PORT=5000 react-scripts start",
"build:package": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c",
"build:web": "yarn run preBuild && react-scripts build",
"build:web:ci": "yarn run preBuild && cross-env PUBLIC_URL=/demo react-scripts --max_old_space_size=4096 build && cpx 'build/**/*' docs/latest/_book/demo --verbose",
"build:web:ci": "yarn run preBuild && react-scripts --max_old_space_size=4096 build && cpx 'build/**/*' docs/latest/_book/demo --verbose",
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}",
"test": "jest",
"test:ci": "jest --ci --runInBand --collectCoverage --reporters=default --reporters=jest-junit && codecov",

20
public/config/default.js Normal file
View File

@ -0,0 +1,20 @@
window.config = {
routerBasename: '/',
rootUrl: 'http://localhost:5000',
servers: {
dicomWeb: [
{
name: 'DCM4CHEE',
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
qidoSupportsIncludeField: true,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
requestOptions: {
requestFromBrowser: true,
},
},
],
},
}

View File

@ -8,27 +8,7 @@ import ReactDOM from 'react-dom'
export { App }
const applicationProps = window.config || {
routerBasename: '/',
rootUrl: 'http://localhost:5000',
servers: {
dicomWeb: [
{
name: 'DCM4CHEE',
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
qidoSupportsIncludeField: true,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
requestOptions: {
requestFromBrowser: true,
},
},
],
},
}
const applicationProps = window.config
const app = React.createElement(App, applicationProps, null)
ReactDOM.render(app, document.getElementById('root'))