Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to serve ionic app with https?

Running ionic serve (ionic serve --lab) allows to run the app on http://localhost:8100/ionic-lab

Trying to access https://localhost:8100/ionic-lab results in:

SSL connection error

Is there a way to run the app on https?

I followed the instructions from the link to overcome SSL error, but couldn't figure out how to use it with ionic (i.e. I don't know how to use cert.pem & key.pem files while starting the server with the command ionic serve --lab)

like image 489
SpaceX Avatar asked Jul 17 '16 01:07

SpaceX


People also ask

How do you serve an ionic app?

By default, ionic serve boots up a development server on localhost . To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI.

Can ionic run on web?

Because Ionic Apps are built with web technologies, they can run just as well as a Progressive Web App as they can a native app.


1 Answers

use --ssl option:

ionic serve --lab --ssl
like image 134
MahdiJoon Avatar answered Sep 21 '22 16:09

MahdiJoon