请教个express问题
代码如下,html文件变成文本输出了,有什么办法解决
var express = require(‘express’), http = require(“http”), app = module.exports = express();
app.engine(’.html’, require(‘ejs’).__express);
app.set(‘views’, __dirname + ‘/views’); app.use(express.directory(__dirname + ‘/views’)) app.use(express.static(__dirname + ‘/views’));
app.set(‘view engine’, ‘html’); var sever = http.createServer(app);
1 回复
没有设置content-type吗?