Class WayContext

Container passed to every middleware/handler combining WayRequest and WayResponse. Most apps interact with bunWay exclusively through this object.

app.use(async (ctx, next) => {
console.log(ctx.req.method, ctx.req.path);
await next();
});

Constructors

Properties

Constructors

  • Instantiate a context for the given request and optional body parser conf.

    Parameters

    • req: Request
    • Optional options: {
          bodyParser?: ResolvedBodyParserOptions;
      }
      • Optional bodyParser?: ResolvedBodyParserOptions

    Returns WayContext

Properties