Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: lib/src/util/path_handler.dart

Issue 2232533002: Rename nestingMiddleware to PathHandler.nestedIn. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « lib/src/runner/browser/platform.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698