mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/routing: move routing to controllers
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user