• This project
    • Loading...
  • Sign in

LI WENHAO / Running-Football

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • Running-Football
  • rf-blog
  • code
  • server
  • middleware
  • log
  • index.js
  • LI WENHAO's avatar
    add blog-admin part · 915aa61b ...
    915aa61b
    add server\admin UI
    server:
      blog manage\label manage\message manage\upload\user
    admin UI:login mode\home\user\auth\label\article\
    LI WENHAO authored 2021-12-07 17:13:21 +0800
index.js 442 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import logger from './log'

export default opts => {
    let loggerMiddleware = logger(opts);
    return async (ctx, next) => {
        return loggerMiddleware(ctx, next)
            .catch( e => {
                if (ctx.status < 500) {
                    ctx.status = 500;
                }
                ctx.log.error(e.stack);
                ctx.state.logged = true;
                ctx.throw(e);
            })
    }
}