1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

Restore baseUrl in router

This commit is contained in:
vrde 2015-10-13 14:19:08 +02:00
parent dc97517d65
commit 7c231a4c5e
4 changed files with 14 additions and 12 deletions

View File

@ -17,16 +17,13 @@ import CoaVerifyContainer from '../../../components/coa_verify_container';
import ErrorNotFoundPage from '../../../components/error_not_found_page';
import App from './prize_app';
import AppConstants from '../../../constants/application_constants';
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
let baseUrl = AppConstants.baseUrl;
function getRoutes() {
return (
<Route path={baseUrl} component={App}>
<Route path='/' component={App}>
<IndexRoute component={Landing} />
<Route
path='login'

View File

@ -33,14 +33,11 @@ import CCRegisterPiece from './components/cc/cc_register_piece';
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
import WalletApp from './wallet_app';
import AppConstants from '../../../constants/application_constants';
let baseUrl = AppConstants.baseUrl;
let ROUTES = {
'cyland': (
<Route path={baseUrl} component={WalletApp}>
<Route path='/' component={WalletApp}>
<IndexRoute component={CylandLanding} />
<Route
path='login'
@ -75,7 +72,7 @@ let ROUTES = {
</Route>
),
'cc': (
<Route path={baseUrl} component={WalletApp}>
<Route path='/' component={WalletApp}>
<Route
path='login'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
@ -109,7 +106,7 @@ let ROUTES = {
</Route>
),
'ikonotv': (
<Route path={baseUrl} component={WalletApp}>
<Route path='/' component={WalletApp}>
<IndexRoute component={IkonotvLanding} />
<Route
path='login'

View File

@ -1,5 +1,13 @@
'use strict';
import useBasename from 'history/lib/useBasename';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import AppConstants from './constants/application_constants';
export default createBrowserHistory();
// Remove the trailing slash if present
let baseUrl = AppConstants.baseUrl.replace(/\/$/, '');
export default useBasename(createBrowserHistory)({
basename: baseUrl
});

View File

@ -33,7 +33,7 @@ import AppConstants from './constants/application_constants';
let baseUrl = AppConstants.baseUrl;
let COMMON_ROUTES = (
<Route path={baseUrl} component={App}>
<Route path='/' component={App}>
<Route
path="login"
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />