As in the application, I need to have some configured variables that must be global, and I use them through modules. My configuration file may look like.
config.js
var config = { baseServiceUrl: 'http://localhost/baseServiceUrl', baseUrl: 'http://localhost/baseUrl', mapping_764: { location:'Austin', emailAddress:' austin@customerservice.com ', registerLink:'https://www.customercare.com/en/austin/registration/', fbLikeLink:'https://www.facebook.com/customercare.austin', microSite: 'http://austin.customercare.com/' } }
I just upload this file with a script tag along with requirejs.
<script src="js/app/config.js"></script>
<script data-main="js/main" src="js/libs/require/require.js"></script>
Now the global variable (object) config can be used in all modules, as well as from the browser console. So I thought that if someone changes these configuration attributes, the application will certainly crash because this configuration variable is used for office calls and for many other things.
Is there any way to deal with such problems.?
source share