diff --git a/openbis_ng_ui/src/js/common/url.js b/openbis_ng_ui/src/js/common/url.js new file mode 100644 index 0000000000000000000000000000000000000000..eead0cf228fb852b0967bfab161ad15461202f3f --- /dev/null +++ b/openbis_ng_ui/src/js/common/url.js @@ -0,0 +1,10 @@ +function getApplicationPath() { + return window.location.pathname.substr( + 0, + window.location.pathname.lastIndexOf('/') + 1 + ) +} + +export default { + getApplicationPath +} diff --git a/openbis_ng_ui/src/js/store/history.js b/openbis_ng_ui/src/js/store/history.js index f8127a63380c5169552e47122549489358b74f01..a37412205f69f2580e9068a74c51b15432042564 100644 --- a/openbis_ng_ui/src/js/store/history.js +++ b/openbis_ng_ui/src/js/store/history.js @@ -1,9 +1,10 @@ import { createBrowserHistory } from 'history' import actions from '@src/js/store/actions/actions.js' import routes from '@src/js/common/consts/routes.js' +import url from '@src/js/common/url.js' let history = createBrowserHistory({ - basename: '#' + basename: url.getApplicationPath() + '#' }) history.configure = store => { diff --git a/openbis_ng_ui/webpack.config.dev.js b/openbis_ng_ui/webpack.config.dev.js index 1505b8b8962e515061867a5bd39d90c05bf3d7b9..a532153ccc0637685edd313a6eb347da68d0f269 100644 --- a/openbis_ng_ui/webpack.config.dev.js +++ b/openbis_ng_ui/webpack.config.dev.js @@ -20,6 +20,7 @@ module.exports = { aggregateTimeout: 300, poll: 1000 }, + publicPath: '/ng-ui-path/', proxy: { '/openbis': { target: 'http://localhost:8888',