common.js 448 Bytes
/**
 *
 * @author: jiangfeng<jeff.jiang@yoho.cn>
 * @date: 16/8/3
 */

'use strict'

import Router from '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);

export default r;