Add custom routes to pages router (#7231)
* added custom routes * fixed docs typos * added page.customRoutes config validation * added 404 response if missing custom route response * added docs * minor README formatting * added CHANGELOG entry * fixed bug in definitions builder that did not recognize array of custom type * added missing route handler definition * fixed custom routes definition
This commit is contained in:
@@ -168,6 +168,11 @@ export class Config {
|
||||
} else if (Object.prototype.toString.call(pages.customUrls) !== '[object Object]') {
|
||||
throw 'Parse Server option pages.customUrls must be an object.';
|
||||
}
|
||||
if (pages.customRoutes === undefined) {
|
||||
pages.customRoutes = PagesOptions.customRoutes.default;
|
||||
} else if (!(pages.customRoutes instanceof Array)) {
|
||||
throw 'Parse Server option pages.customRoutes must be an array.';
|
||||
}
|
||||
}
|
||||
|
||||
static validateIdempotencyOptions(idempotencyOptions) {
|
||||
|
||||
Reference in New Issue
Block a user