Calculating enrollment url when generalConfig.host config exists

This commit is contained in:
Rasika Perera 2016-08-02 15:43:40 +05:30
parent 2e8df6a16a
commit b8bf855378

View File

@ -37,6 +37,12 @@ var conf = function () {
return value;
}
);
if (conf.generalConfig.host) {
//TODO: Move enrollment URL into app-conf.json
var enrollmentHost = conf.generalConfig.host.replace(/https:\/\/localhost(:\d+)?/, conf.httpsURL).replace(
/http:\/\/localhost(:\d+)?/, conf.httpURL);
conf.enrollmentUrl = enrollmentHost + conf.enrollmentDir;
}
application.put("CONF", conf);
}
return conf;