app.js
var exphbs = require('express-handlebars');
app.engine('handlebars', exphbs({defaultLayout: 'layout'}));
app.set('view engine', 'handlebars');
app.use('/catalog', require('./routes/catalog'));
so in my routes folder I have a folder call catalog then within it I have catalog.js.
In catalog.js I do
var express = require('express');
var router = module.exports = express.Router();
router.get('/', function(req, res) {
res.render('catalog/index');
});
It worked fine when I go to http://localhost:3000/catalog but it excluded from the layout when I try to run http://localhost:3000/catalog/ Any idea why?