diff --git a/README.md b/README.md index ca6e9370..402c8706 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # angel_framework -![version 1.0.0-dev.26](https://img.shields.io/badge/version-1.0.0--dev.26-red.svg) +![version 1.0.0-dev.27](https://img.shields.io/badge/version-1.0.0--dev.27-red.svg) ![build status](https://travis-ci.org/angel-dart/framework.svg) Core libraries for the Angel Framework. \ No newline at end of file diff --git a/lib/src/http/controller.dart b/lib/src/http/controller.dart index fbc37927..c575215b 100644 --- a/lib/src/http/controller.dart +++ b/lib/src/http/controller.dart @@ -34,7 +34,11 @@ class Controller { "All controllers must carry an @Expose() declaration."); } - app.use(exposeDecl.path, generateRoutable(classMirror)); + + final routable = new Routable(debug: true); + configureRoutes(routable); + + app.use(exposeDecl.path, routable); TypeMirror typeMirror = reflectType(this.runtimeType); String name = exposeDecl.as; @@ -125,14 +129,11 @@ class Controller { }; } - Routable generateRoutable(ClassMirror classMirror) { - final routable = new Routable(debug: true); - final handlers = []..addAll(exposeDecl.middleware)..addAll(middleware); - + void configureRoutes(Routable routable) { + ClassMirror classMirror = reflectClass(this.runtimeType); InstanceMirror instanceMirror = reflect(this); + final handlers = []..addAll(exposeDecl.middleware)..addAll(middleware); final callback = _callback(instanceMirror, routable, handlers); classMirror.instanceMembers.forEach(callback); - - return routable; } } diff --git a/pubspec.yaml b/pubspec.yaml index 883ce189..eb2f5260 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.0.0-dev.26 +version: 1.0.0-dev.27 description: Core libraries for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_framework