summaryrefslogtreecommitdiffstats
path: root/packages/kadira-flow-router/server/route.js
blob: dd2be1c7ac80c9604ef4ae7ea4e1f9ddf589acde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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) {
 
};