Ngrok Tutorial to Deploy Localhost Apps to Public URLs For Testing Full Tutorial For Beginners

Ngrok Tutorial to Deploy Localhost Apps to Public URLs For Testing Full Tutorial For Beginners

 

Welcome folks today in this post we will be talking about ngrok library by which you can deploy localhost apps instantly on internet.

 

 

Advantages of Ngrok

 

 

You can share localhost apps to public urls instantly

 

useful for rapid testing in short intervals of time

 

it is open source and totally free

 

 

 

Get Started

 

 

In order to get started you need to go to their official website and download it

 

ngrok official website

 

 

Sign Up on Ngrok

 

 

 

 

 

 

 

 

 

 

 

 

Connecting Ngrok by Auth Token

 

 

 

When you signup on ngrok on your dashboard you will get a auth token . Now this will be unique for you. Now you need to copy this and save this somewhere we will use it later.

See also  Node.js Express Project to Export Raw Text to JPG/PNG Image in Browser Using text-to-image Library in Javascript

 

 

 

 

 

Now when you extract the zip file you will get exe file of ngrok. When you run it you will get this cmd screen

 

 

 

 

 

Now execute this command at this cmd to connect ngrok with auth token

 

 

ngrok authtoken ###yourauthtoken###

 

 

 

 

 

Now in the same directory create a index.html file and copy paste the following code

 

 

<!DOCTYPE html>
<html>
  <head>
    <title>Currency Converter in Javascript</title>
    <link
      rel="stylesheet"
      href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
    />
  </head>
  <body>
      <h1 class="text-center">
          Currency Converter
      </h1>
      <p>This is a paragraph</p>
</body>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</html>

 

 

 

Now to deploy this using ngrok public url you need to execute this below command

See also  jQuery Tutorial to Add & Remove Form Input Fields Dynamically in Browser Using HTML5 & Javascript Full Project For Beginners

 

 

ngrok http 3000

 

 

so here ngrok is starting or deploying our application to a random url at port 3000

 

 

 

 

 

As you can see it has deployed app to internet. Anyone having internet access can see our app at this random generated url.

It supports both http and https versions of url. So that’s so great for security

 

Leave a Reply