Cannot find module 'html'

发布时间:2018-11-18编辑:佚名阅读(1520)

Express NodeJS Cannot find module 'html'

app.get('/', function(req, res){
    res.render('index.html');
});

方法一:

var engines = require('consolidate');
app.engine('html', engines.mustache);
app.set('view engine', 'html');

方法二:(纯静态文件)

res.sendFile(path.join(__dirname + '/public/index.html'));


  关键字:Cannot find module 'html'


鼓掌

0

正能量

0

0

呵呵

0


评论区