2020-02-08 01:50:10 +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-02-08 05:36:39 +00:00
|
|
|
static get services(){
|
|
|
|
return [...super.services, 'configs']
|
|
|
|
}
|
2020-02-08 01:50:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Serve the main welcome page.
|
|
|
|
*/
|
|
|
|
welcome(req, res){
|
2020-02-08 05:36:39 +00:00
|
|
|
|
2020-02-08 01:50:10 +00:00
|
|
|
/*
|
|
|
|
* Return the welcome view.
|
|
|
|
* The page() method is added by Flitter and passes some
|
|
|
|
* helpful contextual data to the view as well.
|
|
|
|
*/
|
|
|
|
return res.page('welcome', {user: req.user})
|
|
|
|
}
|
2020-02-08 05:36:39 +00:00
|
|
|
async get_login(req, res){
|
|
|
|
const app_name = this.configs.get('app.name')
|
|
|
|
return res.page('login', {app_name})
|
|
|
|
}
|
2020-02-08 01:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Home
|