Running a local http server on any directory

01/31/2017 By emehany

I often use the python 2.x version to run a HTTP server on any directory which is the default python version on any new mac machine, and it works great on for any static content. You don't need to download or setup a fully furured http server locally to serve static content, here is a handy list of ways to run a HTTP server :

  • Ruby 1.9.2+

    ruby -run -e httpd . -p 3006

  • Python 2.x 

    python -m SimpleHTTPServer 3006 

  • Python 3.x

    python -m http.server 3006

  • PHP 5.4+

    php -S 0.0.0.0:3006

 

Leave a comment

Login to Comment

Loading