MCPcopy
hub / github.com/caprover/caprover / addCustomDomainForApp

Method addCustomDomainForApp

src/datastore/AppsDataStore.ts:445–469  ·  view source on GitHub ↗
(appName: string, customDomain: string)

Source from the content-addressed store, hash-verified

443 }
444
445 addCustomDomainForApp(appName: string, customDomain: string) {
446 const self = this
447
448 return this.getAppDefinition(appName).then(function (app) {
449 app.customDomain = app.customDomain || []
450
451 if (app.customDomain.length > 0) {
452 for (let idx = 0; idx < app.customDomain.length; idx++) {
453 if (app.customDomain[idx].publicDomain === customDomain) {
454 throw ApiStatusCodes.createError(
455 ApiStatusCodes.ILLEGAL_PARAMETER,
456 `App already has customDomain: ${customDomain} attached to app ${appName}`
457 )
458 }
459 }
460 }
461
462 app.customDomain.push({
463 publicDomain: customDomain,
464 hasSsl: false,
465 })
466
467 return self.saveApp(appName, app)
468 })
469 }
470
471 addCustomDomainForAppForMigration(
472 appName: string,

Callers 1

addCustomDomainMethod · 0.80

Calls 4

getAppDefinitionMethod · 0.95
createErrorMethod · 0.80
pushMethod · 0.80
saveAppMethod · 0.80

Tested by

no test coverage detected