Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit ba28d5f

Browse files
committed
Update route matcher
1 parent f63c734 commit ba28d5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ FlareTail.app.Router = class Router {
2727
this.routes = new Map();
2828

2929
// Retrieve the routes from app controllers
30-
for (let [prop, controller] of Object.entries(app.controllers)) {
31-
if ('route' in controller) {
32-
this.routes.set(new RegExp(`^${this.root}${controller.route}$`), controller);
30+
for (let [name, component] of Object.entries(app)) {
31+
if (name.match(/.+Controller$/) && 'route' in component.prototype) {
32+
this.routes.set(new RegExp(`^${this.root}${component.prototype.route}$`), component);
3333
}
3434
}
3535

0 commit comments

Comments
 (0)