I have install handlebars for template handling in node.js app and set the engine to hbs but during runtime it says that ReferenceError: hbs is not defined .(我在node.js应用程序中安装了用于模板处理的车把并将引擎设置为hbs,但是在运行时它说ReferenceError:hbs未定义 。)
const express = require('express');
const app = express();
const PORT = 8080;
const HOST = '0.0.0.0';
app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');
app.get('/home',(req,res)=>{
res.render('home');
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
How to resolve this problem ?(如何解决这个问题?)
ask by Tabish translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…