'use strict';

/* jshint -W098 */
// The Package is past automatically as first parameter
module.exports = function(Moviescode, app, auth, database) {

  app.get('/moviescode/example/anyone', function(req, res, next) {
    res.send('Anyone can access this');
  });

  app.get('/moviescode/example/auth', auth.requiresLogin, function(req, res, next) {
    res.send('Only authenticated users can access this');
  });

  app.get('/moviescode/example/admin', auth.requiresAdmin, function(req, res, next) {
    res.send('Only users with Admin role can access this');
  });

  app.get('/moviescode/example/render', function(req, res, next) {
    Moviescode.render('index', {
      package: 'moviescode'
    }, function(err, html) {
      //Rendering a view from the Package server/views
      res.send(html);
    });
  });
};
