call method

Future<void> call(
  1. Context ctx
)

Handles requests

Implementation

Future<void> call(Context ctx) {
  ctx.route = this;

  ctx.before.addAll(_before);
  ctx.after.addAll(_after);
  ctx.onException.addAll(_onException);

  for (String pathParam in _pathVarMapping.keys) {
    ctx.pathParams[pathParam] = ctx.pathSegments[_pathVarMapping[pathParam]!];
  }
  if (_pathGlobVarMapping != null) {
    ctx.pathParams[_pathGlobVarName!] =
        ctx.pathSegments.skip(_pathGlobVarMapping!).join('/');
  }

  return ctx.execute();
}