2020-04-16 20:38:01 +00:00
|
|
|
const Controller = require('libflitter/controller/Controller')
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Home Controller
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
* Controller for the main homepage of this Flitter app. Methods here
|
|
|
|
* are used as handlers for routes specified in the route files.
|
|
|
|
*/
|
|
|
|
class Home extends Controller {
|
2020-04-22 14:19:25 +00:00
|
|
|
static get services() {
|
|
|
|
return [...super.services, 'Vue']
|
|
|
|
}
|
2020-04-16 20:38:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Serve the main welcome page.
|
|
|
|
*/
|
|
|
|
welcome(req, res){
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the welcome view.
|
|
|
|
* The page() method is added by Flitter and passes some
|
|
|
|
* helpful contextual data to the view as well.
|
|
|
|
*/
|
2020-04-22 14:19:25 +00:00
|
|
|
return res.page('welcome', {
|
|
|
|
user: req.user,
|
|
|
|
...this.Vue.data(),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
async tmpl(req, res) {
|
2020-05-04 01:16:54 +00:00
|
|
|
return res.page('tmpl', {...this.Vue.data(), ...this.Vue.session(req)})
|
2020-04-16 20:38:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Home
|