Creating the controller's files

Now let's create the controller's files in server/controllers:

  1. Create a file called auth.js and add the following code:
     // get gravatar icon from email var gravatar = require('gravatar'); var passport = require('passport'); // Signin GET exports.signin = function(req, res) { // List all Users and sort by Date res.render('login', { title: 'Login Page', message: req.flash('loginMessage') }); }; // Signup GET exports.signup = function(req, res) { // List all Users and sort by Date res.render('signup', { title: 'Signup Page', message: req.flash('signupMessage') }); }; // Profile GET exports.profile = function(req, res) { // List all Users and sort by Date res.render('profile', { title: 'Profile Page', user : req.user, ...

Get Node.js 6.x Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.