Only warning now... Green pipeline?
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-02 11:45:41 -04:00
parent 4176b0be51
commit 92d43edd7a
9 changed files with 381 additions and 33 deletions

View File

@@ -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;