This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/routes/index.js

29 lines
530 B
JavaScript

var express = require('express');
var router = express.Router();
/* GET Home / Login Form */
router.get('/', function(req, res) {
var util = require('util');
var request = util.inspect(req, {depth: 2});
// If the user isn't logged in
if ( ! req.session.uid)
{
res.render('login', {
title: 'Node Task Manager',
csrfToken: req.csrfToken()
});
}
else
{
res.render('index', {
title: 'Node Task Manager',
user: req.session.username,
req: request,
loggedin: true
});
}
});
module.exports = router;