const express = require('express'),
app = express(),
hbs = require('hbs');
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'hbs');
hbs.registerPartials(path.join(__dirname, 'views/partials'));
app.use('/admin', require('./routes/admin'));
const express = require('express'),
app = express(),
AdminController = require('../controllers/AdminController'),
AdminRouter = express.Router();
AdminRouter.use(function (req, res, next) {
if(!req.session.user) {
return res.redirect('/auth/login');
}
app.set("view options", {layout: "admin/layout"});
next();
});
AdminRouter.get('/', AdminController.main);