diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e590d659..4e581b0e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,6 +3,7 @@
+
@@ -91,10 +92,54 @@
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -140,17 +185,27 @@
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -290,8 +345,8 @@
-
+
@@ -699,14 +754,7 @@
-
-
-
- 1481389821679
-
-
-
- 1481389821679
+
1483150316137
@@ -1044,7 +1092,14 @@
1517975306169
-
+
+ 1517975399809
+
+
+
+ 1517975399809
+
+
@@ -1080,7 +1135,7 @@
-
+
@@ -1099,7 +1154,7 @@
-
+
@@ -1139,7 +1194,6 @@
-
@@ -1164,20 +1218,14 @@
-
+
+
-
-
-
-
-
-
-
@@ -1535,24 +1583,76 @@
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/lib/src/http/angel_http.dart b/lib/src/http/angel_http.dart
index 7182ff45..7b0d67f8 100644
--- a/lib/src/http/angel_http.dart
+++ b/lib/src/http/angel_http.dart
@@ -31,7 +31,7 @@ class AngelHttp {
if (path == '/') path = '';
Tuple3>> resolveTuple() {
- Router r = _flattened ?? this;
+ Router r = app.optimizedRouter;
var resolved =
r.resolveAbsolute(path, method: req.method, strip: false);
diff --git a/lib/src/http/server.dart b/lib/src/http/server.dart
index 24503a89..3d58045d 100644
--- a/lib/src/http/server.dart
+++ b/lib/src/http/server.dart
@@ -61,6 +61,9 @@ class Angel extends AngelBase {
/// You may modify this [Map] yourself if you intend to avoid reflection entirely.
Map get preContained => _preContained;
+ /// Returns the [flatten]ed version of this router in production.
+ Router get optimizedRouter => _flattened ?? this;
+
/// Determines whether to allow HTTP request method overrides.
bool allowMethodOverrides = true;