(appName: string, customDomain: string)
| 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, |
no test coverage detected