Host URL for private api in a hybrid application

want to use a javascript private API in our hybrid mobile application. The API uses Host name and 10 digit key to verify the account.


The problem is, my hybrid mobile application doesnot use any host but runs in the url "file:///android_asset/www/index.html"

Please let me know that is there any workaround to solve this issue?

Maybe Im totally ignorant here but can you not just run the applicaiton through localhost with $ ionic serve

Thanks for your reply.when you use serve command it runs on “localhost” in the browser but in the device it doest not have host url it runns from direct url “file:///android_asset/www/index.html”

1 Like

Ahhh I did not know that, thanks :slight_smile:

Why are you serving the entire host name predefined? Your app should resolve the path by itself. Since file:///android_asset/www is your main asset folder, using a different path as host (just a slash for instance) would resolve to the path your seeking for. This should work in your browser as well as on mobile.