DEV Community

Create a Quick Local Web Server with Python and Ngrok

Scott McAllister on May 12, 2019

One of the nice things about starting a new job is that you have to setup all of your development tools and environments from scratch. And some of ...
Collapse
 
kyletaylored profile image
Kyle Taylor

If you're using Homebrew, a good ol' fashion brew install ngrok should work if you don't want to download and move things.

And for others who might be using PHP regularly, you can also use PHP's built in local server in a directory using php -S localhost:3000

Great tips!

Collapse
 
alexdlaird profile image
Alex Laird

This is great!

If you want even quicker access to tunnels alongside like direct access to the ngrok API and all its features through Python, check out pyngrok: pyngrok.readthedocs.io/en/latest/ Full disclosure, I am its developer. Hope others also find it useful!

Collapse
 
dsturbd profile image
DsturbD

This is a great tip. How secure is ngrok?

Collapse
 
stmcallister profile image
Scott McAllister

I didn't feel qualified to answer,so I forwarded your question to Twitter, and got the following response that made a lot of sense.

twitter.com/cybeehive/status/11284...

Collapse
 
dsturbd profile image
DsturbD

hey thanks for the link Scott, appreciate it

Collapse
 
rcaleb68 profile image
Felipe R Valera Mo..

What is the advantage to use python instead of apache server, if any?

Collapse
 
stmcallister profile image
Scott McAllister

Honestly, just presenting it as a quick alternative for development. I found it easier to just run the Python SimpleHTTPServer from the directory I wanted to serve up, rather than remembering how to configure Apache and where to put all my files for Apache to serve them up. But, if you're familiar with Apache, and already have that configured, I'd go with that.

Thanks for the question, and for reading my article!