The ionic CLI gives the option to serve the app via
ionic serve -address=my.backend.server.com
How can I access the address given through this command in the project?
If you need to host dev server on all network interfaces (i.e. --host=0.0.0.0), you can use
ionic serve --external
Then you will have the ability to access you application by navigating to any network interfaces IP (check ipconfig command)
http://192.168.1.68:8100/
...
If you need to host on custom address, please note that CUSTOM_ADDRESS_IP should be an available IP which is assigned to your actual device
ionic serve --address CUSTOM_ADDRESS_IP
Reference
https://ionicframework.com/docs/cli/commands/serve#option-external
If you want to serve the application on your server and not on your local machine and reach the application through the public internet you could do the following:
ionic serve -address=0.0.0.0:8080
Then you should be able to reach the application on:
youripaddress:8080
if the dns zone entry file of your domain points to your server's ip adress you should also be able to reach your application through your domain:
yourdomain.com:8080
Also make sure that the firewall on your server accepts traffic to the port that the application is running on (in this example 8080)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With