Only warning now... Green pipeline?
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { Next } from 'koa';
|
||||
import { KoaContext } from '../types/KoaContext';
|
||||
import { Context, Next } from 'koa';
|
||||
|
||||
export const performanceLogger = async (ctx: KoaContext, next: Next) => {
|
||||
export const performanceLogger = async (ctx: Context, next: Next) => {
|
||||
await next();
|
||||
const rt = ctx.response.get('X-Response-Time');
|
||||
console.log(`${ctx.method} ${ctx.url} - ${rt}`);
|
||||
};
|
||||
|
||||
export const perfromanceTimer = async (ctx: KoaContext, next: Next) => {
|
||||
export const perfromanceTimer = async (ctx: Context, next: Next) => {
|
||||
const start = Date.now();
|
||||
await next();
|
||||
const ms = Date.now() - start;
|
||||
|
||||
Reference in New Issue
Block a user