Express 4.x 使用 ejs 模板引擎时,view改变后缀为.ejs为.html

在app.js中修改加入如下两行代码:

app.engine(‘.html‘, require(‘ejs‘).renderFile);
app.set(‘view engine‘, ‘html‘);

 

文章来自:http://www.cnblogs.com/junethirty/p/4740014.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3