summaryrefslogtreecommitdiff
path: root/app/node_modules/okview/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-06 19:08:07 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-06 19:08:07 -0400
commit21167ce88ea4ad594d213d3a49115f0ebbaed745 (patch)
treed337a8aa37223f4cc57d9ccbee7726914a530917 /app/node_modules/okview/index.js
parent50c06cc74b025e98ebccc90d389d42354f2b2d63 (diff)
Fix god forsaken trailing slashed issue
Diffstat (limited to 'app/node_modules/okview/index.js')
-rw-r--r--app/node_modules/okview/index.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/node_modules/okview/index.js b/app/node_modules/okview/index.js
index 5f3c65c..1ceac03 100644
--- a/app/node_modules/okview/index.js
+++ b/app/node_modules/okview/index.js
@@ -20,7 +20,8 @@ function OKView(options) {
throw new Error('No meta resource provided to view');
if (!options.route)
throw new Error('No route provided to view');
- this.route = options.route;
+ var route = options.route;
+ var mount = options.mount || 'get';
this._template = options.template;
var meta = this._meta = options.meta;
var queries = this._queries = options.queries || [];
@@ -29,6 +30,16 @@ function OKView(options) {
// TODO This bound / unbound thing can probably be expressed in a
// less convoluted way.
var unbound = this.unbound = !!UNBOUND_ROUTE_PATTERN.exec(this.route);
+ Object.defineProperty(this, 'mount', {
+ value: mount,
+ writable: false,
+ enumerable: true
+ });
+ Object.defineProperty(this, 'route', {
+ value: route,
+ writable: false,
+ enumerable: true
+ });
this._middleware = createMiddleware(this);
this._fetchTemplateData = unbound ?
fetchResourceTemplateData : fetchCollectionTemplateData;