Appendix D Installing and using ngrok
We build web applications so that we can share them with others. To share our web applications, we need to make them accessible to the internet.
Going from the applications we have right now into a real production environment will take a few more chapters to fully understand the process, but that doesn’t mean we can’t put our applications on the internet right now. We can do this by using a tool called ngrok (pronounced en-grok). ngrok is a tool that allows us to expose our local web applications to the internet. It’s a great tool for testing and development as well as sharing with friends or coworkers on our progress.
D.1 Installing ngrok
We can install ngrok with the instructions at their website at https://ngrok.com/download. At this location, there is a great step-by-step guide to getting ngrok working on your local machine.
D.2 Verify installation
Assuming you have installed ngrok correctly, you should be able to run the following command:
ngrok --version #A
D.3 Running ngrok
Now that we have verified ngrok is installed, let’s run it:
ngrok http 3011
The command breaks down like this:
- ngrok http—Start an ngrok with an HTTP tunnel.
- 3011—The port we want to expose, which is exactly mapped to http://localhost:3011.
This will output something like the following: