koa-views 404
使用koa-views时访问404
app.js代码如下
'use strict';
const Koa = require('koa');
const app = new Koa();
const views = require('koa-views');
app.use(views(__dirname + '/views', {
extension: 'hbs',
map: { hbs: 'handlebars' }
}));
app.use((ctx, next) => {
return next().then(function () {
ctx.render('index');
});
});
app.listen(4000);
希望各位大大帮忙解惑
6 回复