Hi friends,
I created a note settings/hostconfiguration/jcr:content to configuration (subscription key, service host) for my site. So, I create a clientlib clientlib-config (/etc/designs/abc/clientlib-config) to config the sub scription key and service host.
Example:
settings/hostconfiguration/jcr:content
apiMSubcriptionKey String value="abcxyz123"
serviceHost String value="http://0.0.123.5:8080/service/api/"
config.js code in the clientlib-config
var apiMSubcriptionKey = "abcxyz123";
var url_host = window.location.protocol + "//" + window.location.host;
var url_service = {
'URL': 'http://0.0.123.5:8080/service/api/',
'URL_UPLOAD_IMAGE': '/bin/uploadavatar',
'SUB' : {
'Ocp-Apim-Subscription-Key': apiMSubcriptionKey,
'Authorization': !!localStorage.getItem("__USER_TOKEN")? "Bearer " + localStorage.getItem("__USER_TOKEN"): ""
}
};
In the config.js, I want to get the content value of the apiMSubcriptionKey and serviceHost from settings/hostconfiguration/jcr:content to replace the hard code in config.js.
How to do that?
Thanks & Best regards,
BienHV