We are making a PhoneGap app and trying to use a data service as follows:
$.post(rooturl + '/data/something', { a: 1 }, (res) => {});
The issue: when the app runs on PhoneGap, it is a single page application with no customized server backend. This means I have no way sending across some kind of environment indicator to change the rooturl and direct it at the local NodeJS development server data service, versus the production server.
In other words, how can I have the Javascript on the client-side detect whether or not it is being run in the development environment to properly set the appropriate root url (development / production)?
Unfortunately PhoneGap doesn't address this.
Depending on what tools you are using, looks like your options are: