Move getLocationsSync into apps.js
This commit is contained in:
+12
@@ -65,6 +65,7 @@ exports = module.exports = {
|
||||
appendLogLine,
|
||||
|
||||
getCertificate,
|
||||
getLocationsSync,
|
||||
|
||||
start,
|
||||
stop,
|
||||
@@ -2862,3 +2863,14 @@ async function restoreConfig(app) {
|
||||
|
||||
await update(app.id, data);
|
||||
}
|
||||
|
||||
function getLocationsSync(app) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
|
||||
const locations = [{ domain: app.domain, fqdn: app.fqdn, certificate: app.certificate, type: exports.LOCATION_TYPE_PRIMARY }]
|
||||
.concat(app.secondaryDomains.map(sd => { return { domain: sd.domain, certificate: sd.certificate, fqdn: sd.fqdn, type: exports.LOCATION_TYPE_SECONDARY }; }))
|
||||
.concat(app.redirectDomains.map(rd => { return { domain: rd.domain, certificate: rd.certificate, fqdn: rd.fqdn, type: exports.LOCATION_TYPE_REDIRECT }; }))
|
||||
.concat(app.aliasDomains.map(ad => { return { domain: ad.domain, certificate: ad.certificate, fqdn: ad.fqdn, type: exports.LOCATION_TYPE_ALIAS }; }));
|
||||
|
||||
return locations;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user