I am trying to convert one of my web app to hybrid mobile app using cordova. I am using polymer and web components. I am able to render the UI in ios device also. However I want to know how to configure IP address and port of my server (my laptop in this case) dynamicallly when building or depolying the app. May be some cordova setting (like env variable or build argument)
my html
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="styles/app-theme.html">
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html">
some ajax call.
<iron-ajax id="resetValidate" **url="/api/appusers/reset"** method="post" content-type="application/json" on-response="handleResponse" on-error="handleError"></iron-ajax>
....
So actually I want to call http::/192.168.1.39:3000//api/appusers/reset in this case, but changing code is not a good solution, as I have more than 100 places and more over this ip will be different for all developers and also it will change every time. When application will be ready obviously I will need to configure some baseurl for all apis also, so I want to know what is the way in cordova for this.
This works in web application / browser as I render the html and js files as well api from same express server. So hostname and port is same for static and dynamic content and is localhost during development.