we built a node.js
application for desktop and tablet. It's completely web based application. Now I am planning to implement same application as native app in android
using Apache cordova
.
Under project directory, we have node_modules,public,....
all client side files are in public
folder. When I invoke URL
in browser, from client side I am making API call to check whether user already logged or not. like this we are making API calls to my server.
As per my understanding,native app is nothing but we are storing all the client side files into device. whenever user open app will load client side files and as per work flow it will make API calls.
Theoretically I understand that much.
where I stuck :
In desktop app , I used to make API calls with URL like /api/web/shared/reject/
, here we don't need to mention server address like localhost:8080/api/web/shared/reject/
that everything browser will take care. This same thing how can I make it work in cordova
applications.
How cordova
will know whether it is localhost or something else
...
Regarding this, I Goggled but I didn't find any tutorials.
can anyone suggest me the way.