I have a simple scenario. I am following Max tutorial.
My http://localhost:3000/message
always returns index page. That is only the first route is working. The new route is not working. I am simply trying to put node.hbs
on /message
/routes/app.js
var express = require('express');
var router = express.Router();
router.get('/', function (req, res, next) {
res.render('index');
});
router.get('/messsage', function (req, res, next) {
res.render('node', { message: 'hello' });
});
module.exports = router;
app.js
var appRoutes = require('./routes/app');
app.use('/', appRoutes);
// catch 404 and forward to error handler
app.use(function (req, res, next) {
return res.render('index');
});