0

我喜欢从 JSON 文件构建节点站点。JSON 文件由 Node js 读取。JSON 中有模板名称。我喜欢将 json 多模板组合到文件中。我尝试了这段代码,但这不起作用

app.set('views', __dirname + '/views')
app.set('view engine', 'ejs');
app.use('/public', express.static(__dirname + '/public'));
app.get('/', function (req, res) {
  res.render('home', { teller: 1000 });
  res.render('slider', { start: 1000 }); 
}) 

有没有办法将 ejs 模板合并到一个文件中?

谢谢

4

0 回答 0