Share your local Rails Application via ngrok Link.
By: Prem Kaithwas Category: Ruby on Rails Technologies: Ruby on Rails
- You should have a ngrok account and ngrok should be on your system.
- For assistance with installing ngrok and setting your ngrok account, please visit: https://dashboard.ngrok.com/get-started/setup
Let’s get started with the setting up ngrok in your rails application
1. Start the ngrok server on your desired port number with this command.
Note: you should run this command in the terminal where you have unzipped the ngrok installation file.
If your terminal looks like something above the image, you have started ngrok server on your given port no.
2. Copy the “240f-59–95–101–113.ngrok.io” from the ngrok server you’ve started(have a look at the white rectangle above).
3. Goto application.rb file of the rails application you want to use ngrok for.
4. Add the following line in your application. rb file.
THE LINE: config.hosts << “2a1e-59–95–101–113.ngrok.io”
Note: You will have something different number on “2a1e-59–95–101–113.ngrok.io” mine.
5. Start your application on your local server.
6. Now search in the browser with the link.
Originally published at https://www.cryptextechnologies.com.