1
0
Fork 0
mirror of https://gitlab.com/Alamantus/Readlebee.git synced 2025-03-22 11:28:54 +01:00
Readlebee/app/appRoutes.js
Robbie Antenesse cd0baa7605 Handle log out
It's a little funky because of Choo, but it works right
2019-10-17 21:20:36 -06:00

17 lines
705 B
JavaScript

import { globalView } from './views/global';
import { homeView } from './views/home';
import { loginView } from './views/login';
import { searchView } from './views/search';
import { errorView } from './views/404';
export const appRoutes = (app) => {
app.route('/', (state, emit) => globalView(state, emit, homeView));
app.route('/login', (state, emit) => globalView(state, emit, loginView));
app.route('/logout', () => window.location.reload()); // If Choo navigates here, refresh the page instead so the server can handle it and log out
app.route('/search', (state, emit) => globalView(state, emit, searchView));
app.route('/404', (state, emit) => globalView(state, emit, errorView));
}