This commit is contained in:
thosakwe 2016-11-28 16:48:00 -05:00
parent 774edb4be8
commit 93ea5bf6f1
3 changed files with 10 additions and 9 deletions

View file

@ -1,6 +1,6 @@
# angel_framework # 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) ![build status](https://travis-ci.org/angel-dart/framework.svg)
Core libraries for the Angel Framework. Core libraries for the Angel Framework.

View file

@ -34,7 +34,11 @@ class Controller {
"All controllers must carry an @Expose() declaration."); "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); TypeMirror typeMirror = reflectType(this.runtimeType);
String name = exposeDecl.as; String name = exposeDecl.as;
@ -125,14 +129,11 @@ class Controller {
}; };
} }
Routable generateRoutable(ClassMirror classMirror) { void configureRoutes(Routable routable) {
final routable = new Routable(debug: true); ClassMirror classMirror = reflectClass(this.runtimeType);
final handlers = []..addAll(exposeDecl.middleware)..addAll(middleware);
InstanceMirror instanceMirror = reflect(this); InstanceMirror instanceMirror = reflect(this);
final handlers = []..addAll(exposeDecl.middleware)..addAll(middleware);
final callback = _callback(instanceMirror, routable, handlers); final callback = _callback(instanceMirror, routable, handlers);
classMirror.instanceMembers.forEach(callback); classMirror.instanceMembers.forEach(callback);
return routable;
} }
} }

View file

@ -1,5 +1,5 @@
name: angel_framework name: angel_framework
version: 1.0.0-dev.26 version: 1.0.0-dev.27
description: Core libraries for the Angel framework. description: Core libraries for the Angel framework.
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_framework homepage: https://github.com/angel-dart/angel_framework