Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Ionic as a website

I have created an ionic app and want to deploy it as a website. What's the best way to deploy it on a custom domain? I was thinking of using azure web app to host the ionic app. All the documentation refers to use it as hybrid app for IOS and Android. But at this point, we are only interested for it to function as a website.

like image 298
Ayush Chordia Avatar asked Oct 18 '15 08:10

Ayush Chordia


People also ask

Can I build a website with Ionic?

With Ionic, you only need to write your code once, after which you'll be ready to deploy it across iOS, Android, and the web. Equipped with the web tools and frameworks that your team already knows and loves, you'll save weeks or even months on getting up to speed on a new coding environment.

Is Ionic app a PWA?

You can deploy your app as a PWA as well as Native app and take advantage of both channels. Ionic allows you to ship your app to not only the app store, but also deploy to the mobile web as a PWA.


4 Answers

It is a late answer, but as an official for Ionic 2:

With Ionic 2 we are fully supporting the web (including eventual built in support for Progressive web apps) as a platform right alongside Android, IOS, Windows 10 and Electron. Thanks for using Ionic!

And

If you are using certain Cordova plugins that only work on native platforms then these will not work on the web, although if you are using Ionic native they will fail gracefully. But if you stay away from using those certain plugins, or write logic to provide an alternative when on the web then it should work perfectly. Also, our browser support includes Chrome, Safari, Firefox, Opera(since it's just chrome nowadays), and Edge. We do not support any version of Internet Explorer with Ionic 2. So basically, as long as you keep Cordova plugins in mind, the same Ionic 2 project that works on your Android, IOS or Windows 10 device will work just as well in the browser. Thanks!

The source for this: https://github.com/ionic-team/ionic/issues/7376


From my experience in Ionic 1, it is simple to work on a website, it is just copy/paste for www directory, actually, it does make sense, you are running AngularJS website! you could have a few errors and some of the functionalities not working (i mean the native plugins as for example facebookConnect) but you can handle it and run the web-specific version instead.

In our company, we do have an application work as a website with firebase, and mobile app with the same code, but you do need to write a few lines to handle web browsing side or mobile native call.

like image 44
Al-Mothafar Avatar answered Oct 08 '22 06:10

Al-Mothafar


edit: Ionic 1.2 officially supports deployment as a website!

As I stated in the comment to the only provided answer - I disagree.

If you're not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila - you'll have the same app.

However, it is important to note that Ionic never intended for such a use, and the users of your "website" will have to have a newest browser in order to see the "website" correctly (not broken down due to some feature that Ionic is using in either CSS or HTML that some older browsers do not support).

You can take a look at the tutorial with step by step on how to recreate the application. I literally took out the contents of the www folder and put it on the web server, and as you can see it works.

like image 130
Nikola Avatar answered Oct 08 '22 08:10

Nikola


For ionic2, add corbova browser platform, then upload to web server platforms/browser/www

like image 4
Luca C. Avatar answered Oct 08 '22 06:10

Luca C.


Check my answer ionic: using the framework with only HTML5 on the idea of using it as a web application.

You could deploy it as static website on s3 and use your custom domain to point to s3. You can configure your s3 bucket to be used as a static website host. There are many tutorials on how to go about it.

like image 2
Nirav Gandhi Avatar answered Oct 08 '22 08:10

Nirav Gandhi