registerRouteWithAuth method

void registerRouteWithAuth (
  1. String method,
  2. String route,
  3. Schema schema,
  4. dynamic authorize(
    1. RequestContext req,
    2. ResponseContext res,
    3. dynamic next(
        )
      ),
    4. dynamic action(
      1. RequestContext req,
      2. ResponseContext res
      )
    )
    inherited

    Registers a route with authorization in HTTP endpoint.

    • method HTTP method: 'get', 'head', 'post', 'put', 'delete'
    • route a command route. Base route will be added to this route
    • schema a validation schema to validate received parameters.
    • authorize an authorization interceptor
    • action an action function that is called when operation is invoked.