Index: lib/src/util/path_handler.dart |
diff --git a/lib/src/util/path_handler.dart b/lib/src/util/path_handler.dart |
index aa8d054206b1a238c3605b1436bf553d770796f1..56597131630ba9e71be76a3f9e8ef398764cfc90 100644 |
--- a/lib/src/util/path_handler.dart |
+++ b/lib/src/util/path_handler.dart |
@@ -13,7 +13,14 @@ class PathHandler { |
/// The shelf handler. |
shelf.Handler get handler => _onRequest; |
- PathHandler(); |
+ /// Returns middleware that nests all requests beneath the URL prefix |
+ /// [beneath]. |
+ static shelf.Middleware nestedIn(String beneath) { |
+ return (handler) { |
+ var pathHandler = new PathHandler()..add(beneath, handler); |
+ return pathHandler.handler; |
+ }; |
+ } |
/// Routes requests at or under [path] to [handler]. |
/// |
@@ -47,14 +54,6 @@ class PathHandler { |
} |
} |
-/// Returns middleware that nests all requests beneath the URL prefix [beneath]. |
-shelf.Middleware nestingMiddleware(String beneath) { |
- return (handler) { |
- var pathHandler = new PathHandler()..add(beneath, handler); |
- return pathHandler.handler; |
- }; |
-} |
- |
/// A trie node. |
class _Node { |
shelf.Handler handler; |