注册ejs模板为html页。以.ejs为后缀的模板页,现在的后缀名可以是.html
app.engine('.html', require('ejs').__express);
设置视图模板的默认后缀名为.html,避免了每次res.Render("xx.html")的尴尬
app.set('view engine', 'html');
设置模板文件文件夹
app.set('views', __dirname + '/views');

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-07-07
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2021-11-22
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案