如何将/about
重定向到/about/
以及我在Express中的所有其他后续路线?我听说这是最好的做法。
app.js
// Enable strict routing
app.set('strict routing', true);
app.route('/').get(function(req, res) {
res.render('index', {
title: 'Welcome'
});
});
app.route('/about').get(function(req, res) {
res.render('about', {
title: 'About'
});
});
//etc