mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 17:30:13 +01:00
29 lines
615 B
JavaScript
29 lines
615 B
JavaScript
|
|
Route = function(router, pathDef, options) {
|
||
|
|
options = options || {};
|
||
|
|
this.options = options;
|
||
|
|
this.name = options.name;
|
||
|
|
this.pathDef = pathDef;
|
||
|
|
|
||
|
|
// Route.path is deprecated and will be removed in 3.0
|
||
|
|
this.path = pathDef;
|
||
|
|
|
||
|
|
this.action = options.action || Function.prototype;
|
||
|
|
this.subscriptions = options.subscriptions || Function.prototype;
|
||
|
|
this._subsMap = {};
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
Route.prototype.register = function(name, sub, options) {
|
||
|
|
this._subsMap[name] = sub;
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
Route.prototype.subscription = function(name) {
|
||
|
|
return this._subsMap[name];
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
Route.prototype.middleware = function(middleware) {
|
||
|
|
|
||
|
|
};
|