Tuesday, August 08, 2017

How to connect the localhost Rails site via Mobile locally

If you want to test your app locally in a mobile or tablet, without the need to have a server, you can try ngrok.  Ngrok is a very cool, lightweight tool that creates a secure tunnel on your local machine along with a public URL you can use for browsing your local site.

It is very simple to use. Follow these steps:

Step 1

Download ngrok and install it.

Step 2

Run your Rails app:
$ rails s

Step 3

Go to the directory where you extracted the zip file and run it.

$  ./ngrok http 3000

Step 4
You can now access the Rails app from the URL displayed in the ngrok output. It will be something like: http://2ec640eb.ngrok.io

No comments:

Post a Comment