eecs448-project-4/app/controllers/Home.controller.js

24 lines
550 B
JavaScript
Raw Normal View History

2020-11-01 18:50:03 +00:00
const { Controller } = require('libflitter')
/*
* 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 {
/*
* Serve the main welcome page.
*/
welcome(req, res){
if ( req.user ) {
return res.redirect('/app')
} else {
return res.redirect('/auth/login')
}
2020-11-01 18:50:03 +00:00
}
}
module.exports = Home