Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run livereload server on localhost after running Ionic serve command?

I recently started learning Ionic Framework. You can use Ionic serve command inside the project to run a livereload server. Once in a while it asked whether server should run on localhost or system ip. I chose second option. Now It doesn't ask anything and directly runs on system's ip.

How do reset this automatic behaviour?

I tried looking into serve.js file in ionic-cli project but no luck.

like image 741
kushdilip Avatar asked Sep 12 '14 19:09

kushdilip


People also ask

Which command can you use to start the server for an ionic app?

ionic serve uses the Angular CLI. Use ng serve --help to list all Angular CLI options for serving your app. See the ng serve docs for explanations.

How does ionic serve work?

Details. Easily spin up a development server which launches in your browser. It watches for changes in your source files and automatically reloads with the updated build. By default, ionic serve boots up a development server on all network interfaces and prints the external address(es) on which your app is being served ...

How do you stop an ionic serve?

ionic serve run the app and then ctrl + c to cancel.

How do I change the port on an ionic serve?

If you want to specify the ports themselves, you can pass additional option arguments when you run ionic serve like — port|-p for an specific web server port. If you try ionic serve -p 8200 -i 35730, the app runs perfectly with the custom web server and livereload port in your browser.


1 Answers

It's not necessary to edit the code. You can switch between addresses with the command ionic address. You'll then get options like this:

Please select which address to use by entering its number from the list below:
 1) 10.0.1.7 (en1)
 2) localhost
like image 193
Kwoxford Avatar answered Oct 01 '22 16:10

Kwoxford