EXPRESS&KOA2模板后缀修改
KOA2`
const Koa = require(‘koa’);
const app = new Koa();
…
const ejs = require(‘ejs’);
…
app.use(views(__dirname + ‘/views’, {
map : {html:’ejs’}
}));
EXPRESS
// view engine setup
app.set(‘views’, path.join(__dirname, ‘views’));
app.set(‘view engine’, ‘html’);
// .ejs -> .html
var ejs = require(‘ejs’);
ejs.delimiter = ‘!—-‘;
app.engine(‘.html’, ejs.renderFile);
`
EXPRESS&KOA2模板后缀修改
http://example.com/2017-08-08/