MCPcopy
hub / github.com/parse-community/parse-server / validatePublicServerURL

Method validatePublicServerURL

src/Config.js:498–520  ·  view source on GitHub ↗
({ publicServerURL, required = false })

Source from the content-addressed store, hash-verified

496 }
497
498 static validatePublicServerURL({ publicServerURL, required = false }) {
499 if (!publicServerURL) {
500 if (!required) {
501 return;
502 }
503 throw 'The option publicServerURL is required.';
504 }
505
506 const type = typeof publicServerURL;
507
508 if (type === 'string') {
509 if (!publicServerURL.startsWith('http://') && !publicServerURL.startsWith('https://')) {
510 throw 'The option publicServerURL must be a valid URL starting with http:// or https://.';
511 }
512 return;
513 }
514
515 if (type === 'function') {
516 return;
517 }
518
519 throw `The option publicServerURL must be a string or function, but got ${type}.`;
520 }
521
522 static validateEmailConfiguration({
523 emailAdapter,

Callers 2

validateOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected