Hosting an ionic 2 application on web server

This may sound like a stupid question, but is there any way to host an ionic 2 application on a web server? I need people to test my application and rather than using ionic view or publishing it to the app store, I was wondering if there is a way to host it on the web?

Thanks

Sure, but note that all Cordova functionality (like native plugins) won’t work, of course.

Build it, copy /www to the webserver, done.

1 Like

Are there any ways to set the app so that it is displayed as an application? I want to avoid having to instruct testers to ctrl+i and run in phone mode.

So you want your users to use a desktop browser to test, but see the design / size as it would be in an app?

Easiest solution would be to upload the app in a subfolder, create a index.html in the main folder with an iframe that shows index.html from that subfolder and make that the proper size.

There actually is a similar tool in Ionic CLI, ionic serve --lab where you can display it for multiple platforms at the same time. Look at the URLs in the iFrame, it will tell you the parameters you can add to the URL of the app to “preselect” a platform to make it render for e.g. Android or iOS.

1 Like