Task #17 - Created login page added to routing and replaced name mentions with app_name token

This commit is contained in:
2020-02-07 23:36:39 -06:00
parent e5f3410b8b
commit b4d16d764e
5 changed files with 71 additions and 4 deletions

View File

@@ -7,12 +7,15 @@ const Controller = require('libflitter/controller/Controller')
* are used as handlers for routes specified in the route files.
*/
class Home extends Controller {
static get services(){
return [...super.services, 'configs']
}
/*
* Serve the main welcome page.
*/
welcome(req, res){
/*
* Return the welcome view.
* The page() method is added by Flitter and passes some
@@ -20,6 +23,10 @@ class Home extends Controller {
*/
return res.page('welcome', {user: req.user})
}
async get_login(req, res){
const app_name = this.configs.get('app.name')
return res.page('login', {app_name})
}
}
module.exports = Home