registerInterceptor method

void registerInterceptor(
  1. String route,
  2. dynamic action(
    1. Request req
    )
)

Registers a middleware for a given route in HTTP endpoint.

  • route a command route. Base route will be added to this route
  • action an action function that is called when middleware is invoked.

Implementation

void registerInterceptor(String route, Function(Request req) action) {
  if (endpoint == null) return;
  route = _appendBaseRoute(route);
  endpoint!.registerInterceptor(route, action);
}