So we've a global javascript but that script has certain URL's specific to environments. What's the best practice to have different URL's configured based on environment.
Does anyone have good examples how to do this?
Views
Replies
Total Likes
I would suggest to configure the URLs in run mode specific OSGI configuration nodes. And then you can read those variables in the page head.jsp and render them as global variables inside the <script> tag. The JS file can simply use these variables to fetch the URLs value.
Views
Replies
Total Likes
Agree - define your values in OSGi config and retrieve them and use them in a JS function.
Views
Replies
Total Likes
Hi,
1. Have all these configurations in OSGI config Mgr
2. Create a OSGI service to populate these on page load in <head></head> section page in script tag,
3. Now you can directly read these global url from anywhere in page
This is one of the good, easy way to have environment specific URL in JS
Views
Replies
Total Likes
Views
Likes
Replies