devbug/app/controllers/Home.controller.js

31 lines
744 B
JavaScript
Raw Normal View History

2019-06-21 22:01:34 +00:00
/*
* 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 {
/*
* Serve the main welcome page.
*/
welcome(req, res){
2019-06-21 22:54:10 +00:00
let pass = {}
if ( req.session.auth && req.session.auth.user ){
pass['user'] = req.session.auth.user
}
2019-06-21 22:01:34 +00:00
/*
* Return the welcome view.
* It must be passed the response.
* View parameters can be passed as an optional third
* argument to the view() method.
*/
2019-06-21 22:54:10 +00:00
return _flitter.view(res, 'welcome', pass)
2019-06-21 22:01:34 +00:00
}
}
module.exports = Home