Libraries
    Preparing search index...

    Type Alias Middleware

    Middleware: (
        context: RequestContext,
        next: () => Promise<void>,
    ) => Promise<void>

    A middleware function in the request pipeline.

    Call next() to pass control to the next middleware or the endpoint handler. If next() is not called, the pipeline short-circuits.

    Type Declaration

      • (context: RequestContext, next: () => Promise<void>): Promise<void>
      • Parameters

        Returns Promise<void>

    const logger: Middleware = async (ctx, next) => {
    console.log(ctx.method, ctx.url.pathname);
    await next();
    };