common.js
455 Bytes
/**
*
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/8/3
*/
'use strict'
const Router = require('koa-router');
let r = new Router();
const CommonPage = {
page_404: async function(ctx) {
await ctx.render('action/404');
},
page_500: async function(ctx) {
await ctx.render('action/500', {error: ctx.local.error});
}
};
r.get('/404', CommonPage.page_404);
r.get('/500', CommonPage.page_500);
module.exports = r;