Your own, personal, HTTP Server

by Sergio Gianazza, Founder

Imagine you're building a ye-olde HTML basic page

When you're building a webapp and you want to test it on your browser you can always use Ctrl-o or Cmd-o and open the .html file.

The thing get a little complicated when you're using Firefox and you're using webfonts. Firefox don't process your webfont if you're on a local environment. That's when you need an HTTP Server.

Here you have two options:

Create some virtual host using Apache or Nginx, or Use the magical power of python:

python -m SimpleHTTPServer <PORT>

Well, this command works if you're using Python 2. If you're using Python 3 you need to use a different command (though, simple, too):

python -m http.server <PORT>

Last week, when I was building something with my friends at SCV, I had to test if our site looks well. And I used the python solution every time.

The things is, I'm actually working with ruby so I wondered if there is some solution to this problem using ruby. And there is a solution, here is:

ruby -run -e httpd . -p 5000

This script will start a web server using the current directory as a root and will listen on port 5000.

More articles

Our thoughts on how to run good Retrospectives

Tips and Tricks to run a good retrospective

Read more

Stop stop using X and move to Y

Why you should not think always to move to the next cool technology

Read more

Tell us about your project