author avatar

nitturu.baba

Wed Oct 09 2024

Fastest way to put website on internet:

Using Ngrok we can do that easily.

step1: install Ngrok

step2: create account in Ngrok website (for AUTHTOKEN)

step3: run the command in the terminal - ngrok authtoken YOUR_AUTHTOKEN

step4: add the regex in config/environment/development.rb




Rails.application.configure do
    # Other configurations...
    
    # Add your Ngrok URL to the list of allowed hosts 
    config.hosts << /[a-z0-9\-]+\.ngrok-free\.app/
end



step5: start the server and open new terminal then in the project directory run the command ngrok http 3000 . Where 3000 is port number in which localhost is running.

step6: ngrok will give us a link, with that link we can access the website.

Ngrok is not only limited to rails. We can use with any framework.

#CU6U0R822 #ngrok