2019-09-25 20:32:52 +02:00
|
|
|
import { globalView } from './views/global';
|
|
|
|
import { homeView } from './views/home';
|
2019-10-28 07:01:27 +01:00
|
|
|
import { aboutView } from './views/about';
|
2019-09-25 20:32:52 +02:00
|
|
|
import { loginView } from './views/login';
|
|
|
|
import { searchView } from './views/search';
|
|
|
|
import { errorView } from './views/404';
|
|
|
|
|
|
|
|
export const appRoutes = (app) => {
|
2019-09-26 00:48:35 +02:00
|
|
|
app.route('/', (state, emit) => globalView(state, emit, homeView));
|
2019-09-25 20:32:52 +02:00
|
|
|
|
2019-10-28 07:01:27 +01:00
|
|
|
app.route('/about', (state, emit) => globalView(state, emit, aboutView));
|
|
|
|
|
2019-09-26 00:48:35 +02:00
|
|
|
app.route('/login', (state, emit) => globalView(state, emit, loginView));
|
2019-09-25 20:32:52 +02:00
|
|
|
|
2019-10-18 05:20:36 +02:00
|
|
|
app.route('/logout', () => window.location.reload()); // If Choo navigates here, refresh the page instead so the server can handle it and log out
|
|
|
|
|
2019-09-26 00:48:35 +02:00
|
|
|
app.route('/search', (state, emit) => globalView(state, emit, searchView));
|
2019-09-25 20:32:52 +02:00
|
|
|
|
2019-09-26 00:48:35 +02:00
|
|
|
app.route('/404', (state, emit) => globalView(state, emit, errorView));
|
2019-09-25 20:32:52 +02:00
|
|
|
}
|