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.
next()
const logger: Middleware = async (ctx, next) => { console.log(ctx.method, ctx.url.pathname); await next();}; Copy
const logger: Middleware = async (ctx, next) => { console.log(ctx.method, ctx.url.pathname); await next();};
A middleware function in the request pipeline.
Call
next()to pass control to the next middleware or the endpoint handler. Ifnext()is not called, the pipeline short-circuits.