How to run a local Phoenix app on another machine

RMAG news

When you create a new Phoenix app, it uses the 127.0.0.1 IP address by default. To run it locally on another machine (e.g. your phone), you need to change this on config/dev.exs.

Find the http config on that file. You’ll see something like this:

http: [ip: {127, 0, 0, 1}, port: 4000]

Now, change it to:

http: [ip: {0, 0, 0, 0}, port: 4000]

That’s it! Now you’ll be able to test your Phoenix app locally on other machines by using your network’s IP address.