2015-10-05 11:52:23 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-13 14:19:08 +02:00
|
|
|
import useBasename from 'history/lib/useBasename';
|
2016-01-11 17:52:32 +01:00
|
|
|
import useQueries from 'history/lib/useQueries';
|
2015-10-05 11:52:23 +02:00
|
|
|
import createBrowserHistory from 'history/lib/createBrowserHistory';
|
2015-10-13 14:19:08 +02:00
|
|
|
import AppConstants from './constants/application_constants';
|
2015-10-05 11:52:23 +02:00
|
|
|
|
2015-10-13 14:19:08 +02:00
|
|
|
|
|
|
|
// Remove the trailing slash if present
|
2016-02-05 10:38:59 +01:00
|
|
|
const baseUrl = AppConstants.baseUrl.replace(/\/$/, '');
|
2015-10-13 14:19:08 +02:00
|
|
|
|
2016-02-05 10:38:59 +01:00
|
|
|
const history = useBasename(useQueries(createBrowserHistory))({
|
2015-10-13 14:19:08 +02:00
|
|
|
basename: baseUrl
|
|
|
|
});
|
2016-02-05 10:38:59 +01:00
|
|
|
|
|
|
|
history.locationQueue = [];
|
|
|
|
|
|
|
|
export default history;
|