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

时间:2015-08-18 18:58:27   收藏:0   阅读:2996

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

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

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!