title: PhoneGap environment variables with regards to AJAX data service in a development environment?
body: <p>We are making a PhoneGap app and trying to use a data service as follows:</p>
  
  <pre><code>$.post(rooturl + '/data/something', { a: 1 }, (res) =&gt; {});
  </code></pre>
  
  <p>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.</p>
  
  <p>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)?</p>