platform/lib/src/middleware_pipeline.dart
2016-12-18 23:43:55 -05:00

20 lines
509 B
Dart

import 'router.dart';
/// A chain of arbitrary handlers obtained by routing a path.
class MiddlewarePipeline {
/// All the possible routes that matched the given path.
final List<RoutingResult> routingResults;
/// An ordered list of every handler delegated to handle this request.
List get handlers {
final handlers = [];
for (RoutingResult result in routingResults) {
handlers.addAll(result.allHandlers);
}
return handlers;
}
MiddlewarePipeline(this.routingResults);
}