# HG changeset patch # User ymh # Date 1497886203 -7200 # Node ID fad489be9c771cf509d3ca0bfbd44cb4c8365b0c # Parent d8588379529e1b5112721c633cae9d82c683973f add some config values diff -r d8588379529e -r fad489be9c77 .hgignore --- a/.hgignore Mon Jun 19 17:56:41 2017 +0200 +++ b/.hgignore Mon Jun 19 17:30:03 2017 +0200 @@ -33,3 +33,6 @@ ^src/MANIFEST.in ^src/MANIFEST ^src/irinotes.egg-info/ + +^design/Gemfile +.ruby-version$ diff -r d8588379529e -r fad489be9c77 client/.env --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/.env Mon Jun 19 17:30:03 2017 +0200 @@ -0,0 +1,2 @@ +REACT_APP_API_ROOT_URL = http://localhost:8000 +REACT_APP_BASENAME = diff -r d8588379529e -r fad489be9c77 client/src/config.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/config.js Mon Jun 19 17:30:03 2017 +0200 @@ -0,0 +1,6 @@ +// define application configuration + +export default { + apiRootUrl: process.env.REACT_APP_API_ROOT_URL, + basename: process.env.REACT_APP_BASENAME +} diff -r d8588379529e -r fad489be9c77 client/src/index.js --- a/client/src/index.js Mon Jun 19 17:56:41 2017 +0200 +++ b/client/src/index.js Mon Jun 19 17:30:03 2017 +0200 @@ -13,8 +13,11 @@ import './index.css'; import registerServiceWorker from './registerServiceWorker'; import configureStore from './store/configureStore'; +import config from './config'; -const history = createHistory(); +const history = createHistory({ + basename: config.basename +}); const store = configureStore(history); ReactDOM.render( diff -r d8588379529e -r fad489be9c77 client/src/sagas/index.js --- a/client/src/sagas/index.js Mon Jun 19 17:56:41 2017 +0200 +++ b/client/src/sagas/index.js Mon Jun 19 17:30:03 2017 +0200 @@ -4,6 +4,7 @@ import PouchDBFind from 'pouchdb-find'; import Immutable from 'immutable'; import APIClient from '../APIClient'; +import config from '../config'; PouchDB.debug.disable(); PouchDB.plugin(PouchDBFind); @@ -14,7 +15,7 @@ index: { fields: ['session'] } }); -const client = new APIClient('http://localhost:8000') +const client = new APIClient(config.apiRootUrl); // ---