mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-14 17:19:37 +08:00
app: debug info
This commit is contained in:
10
middleware/debug.js
Normal file
10
middleware/debug.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = async (ctx, next) => {
|
||||
await next();
|
||||
|
||||
if (ctx.request.path !== '/') {
|
||||
ctx.debug.request++;
|
||||
if (ctx.response.get('X-Koa-Redis-Cache') || ctx.response.get('X-Koa-Memory-Cache')) {
|
||||
ctx.debug.hitCache++;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user