Skip to content

Commit

Permalink
fix(policies): add /?* wildcard on policied routes
Browse files Browse the repository at this point in the history
  • Loading branch information
crobinson42 committed Oct 3, 2016
1 parent d534248 commit a6a63f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ var JsDataServerSetup = function () {
this.adapters = config.adapters;

// register default adapter on container
if (!this.adapter) {
throw new Error('JsDataServerSetup adapter is required');
}
this.registerAdapter(this.container, { adapter: this.adapter, name: 'containerDefaultAdapter' });

// instantiate a router to use (later added to this.app in this.mount())
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class JsDataServerSetup {
this.adapters = config.adapters

// register default adapter on container
if (!this.adapter) { throw new Error(`JsDataServerSetup adapter is required`) }
this.registerAdapter(this.container, {adapter: this.adapter, name: 'containerDefaultAdapter'})

// instantiate a router to use (later added to this.app in this.mount())
Expand Down Expand Up @@ -150,7 +151,7 @@ export default class JsDataServerSetup {

// only mount if actionMiddleware is not an empty array
if (actionMiddleware.length > 0) {
this.apiRoutes[method](routePath, actionMiddleware)
this.apiRoutes[method](routePath + '/?*', actionMiddleware)
}
}, this) // end > Object.keys().forEach()
} else {
Expand All @@ -170,6 +171,7 @@ export default class JsDataServerSetup {
}

// mount this resource
// @NOTE/@TODO currently Router does not accept the 2nd argument
this.apiRoutes.use(
routePath,
new Router(this.resources[name], endpointConfig).router
Expand Down

0 comments on commit a6a63f1

Please sign in to comment.