mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Increased route specificity for API error handling (#11795)
no-issue This ensures that errors that are not part of the members frontend API will be handled by the theme and not with JSON
This commit is contained in:
parent
bcfde580c7
commit
27a5887696
1 changed files with 6 additions and 2 deletions
|
@ -39,8 +39,12 @@ module.exports = function setupMembersApp() {
|
|||
membersApp.put('/api/subscriptions/:id', (req, res, next) => membersService.api.middleware.updateSubscription(req, res, next));
|
||||
|
||||
// API error handling
|
||||
membersApp.use(shared.middlewares.errorHandler.resourceNotFound);
|
||||
membersApp.use(shared.middlewares.errorHandler.handleJSONResponseV2);
|
||||
membersApp.use('/api', shared.middlewares.errorHandler.resourceNotFound);
|
||||
membersApp.use('/api', shared.middlewares.errorHandler.handleJSONResponseV2);
|
||||
|
||||
// Webhook error handling
|
||||
membersApp.use('/webhooks', shared.middlewares.errorHandler.resourceNotFound);
|
||||
membersApp.use('/webhooks', shared.middlewares.errorHandler.handleJSONResponseV2);
|
||||
|
||||
debug('Members App setup end');
|
||||
|
||||
|
|
Loading…
Reference in a new issue