client/routing: move routing to controllers

This commit is contained in:
rr-
2016-04-06 21:49:26 +02:00
parent 55cc7b59e4
commit 5f29fa12c2
13 changed files with 92 additions and 62 deletions

View File

@ -1,5 +1,6 @@
'use strict';
const page = require('page');
const topNavController = require('../controllers/top_nav_controller.js');
const HomeView = require('../views/home_view.js');
@ -8,6 +9,11 @@ class HomeController {
this.homeView = new HomeView();
}
registerRoutes() {
page('/', (ctx, next) => { this.indexRoute(); });
page('*', (ctx, next) => { this.notFoundRoute(); });
}
indexRoute() {
topNavController.activate('home');
this.homeView.render();