From 85b529ef00699fe2fadd0c3e40bfa0d904d0be78 Mon Sep 17 00:00:00 2001 From: regiostech Date: Fri, 1 Jul 2016 15:18:37 -0400 Subject: [PATCH] Working on changes, in line with angel_examples --- .gitignore | 1 + lib/src/http/controller.dart | 4 +++- lib/src/http/routable.dart | 10 +++++++++- pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 917abe7c..951d3784 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ packages # Include when developing application packages. pubspec.lock +doc/api \ No newline at end of file diff --git a/lib/src/http/controller.dart b/lib/src/http/controller.dart index d19a98c9..6f795afc 100644 --- a/lib/src/http/controller.dart +++ b/lib/src/http/controller.dart @@ -83,7 +83,9 @@ class Controller { Route route = new Route( exposeMirror.reflectee.method, exposeMirror.reflectee.path, - [handler]..addAll(exposeMirror.reflectee.middleware)); + [] + ..addAll(exposeMirror.reflectee.middleware) + ..add(handler)); routes.add(route); String name = exposeMirror.reflectee.as; diff --git a/lib/src/http/routable.dart b/lib/src/http/routable.dart index e3dd0439..3722a4b8 100644 --- a/lib/src/http/routable.dart +++ b/lib/src/http/routable.dart @@ -76,7 +76,15 @@ class Routable extends Extensible { new RegExp(r'(^\/+)|(\/+$)'), '')] = service; _routable = service; } - + + if (_routable is Angel) { + all(path, (RequestContext req, ResponseContext res) async { + req.app = _routable; + res.app = _routable; + return true; + }); + } + for (Route route in _routable.routes) { Route provisional = new Route('', path); if (route.path == '/') { diff --git a/pubspec.yaml b/pubspec.yaml index 852d5697..31832234 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.0.0-dev+6 +version: 1.0.0-dev.8 description: Core libraries for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_framework