app.js ejs 转换为html

时间:2023-03-08 17:59:29
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser'); var routes = require('./routes/index');
var users = require('./routes/users'); var app = express(); // view engine setup
app.set('views', path.join(__dirname, 'views'));

app.engine('.html', require('ejs').renderFile);

app.set('view engine', 'html');

亲测好用
其他的与ejs相同