module.exports = {
'GET /': async(ctx, next) => {
//获取数据
var fs = require('fs');
var datas = JSON.parse(fs.readFileSync('./date.json', 'utf-8'));
//渲染模板
ctx.render('index.html', { res: datas });
},
'GET /del/:id': async(ctx, next) => {
console.log(ctx.response);
}
};
相关分类