Skip to content

Commit

Permalink
fix: don’t handle /hoodie/*/api requests by the public /hoodie/*
Browse files Browse the repository at this point in the history
…route handler
  • Loading branch information
gr2m committed Jan 10, 2017
1 parent a5f53d7 commit b334298
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
17 changes: 16 additions & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@ function register (server, options, next) {
return next(error)
}

next(null, server, options)
// we register a router handler for /hoodie/* which must be registered
// after all other plugins, otherwise routes like /hoodie/account/api/*
// will be handled by the public route handler
server.register({
register: require('./plugins/public'),
options: {
config: options
}
}, function (error) {
/* istanbul ignore next */
if (error) {
return next(error)
}

next(null, server, options)
})
})
})
}
3 changes: 1 addition & 2 deletions server/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function registerPlugins (server, config, callback) {
var localPlugins = [
'./client',
'./logger',
'./maybe-force-gzip',
'./public'
'./maybe-force-gzip'
]
.concat(
[
Expand Down

0 comments on commit b334298

Please sign in to comment.