Open dotku opened 8 years ago
I found the answer: instead using app.get(), the router should use router.get()
'use strict';
var express = require('express');
var router = express.Router();
router.get('/', function (req, res) {
res.render('home', {
title: 'Home'
});
});
module.exports = router;
Hi, express-handlebars sample actually runs, but when I convert the app.get() to route file, I got error. Here is my code in /route/index.js
I just take the idea from here: http://stackoverflow.com/questions/25596803/express-4-with-handlebars-add-new-route/25597043#25597043
I also upload my full code to my github branch: https://github.com/dotku/node-study/tree/express_4.x_router