Simple Server

03/12/2014, Wed
Categories: #Shell

No nodejs required

Many times there are code samples on Github that have simple static files that you would want to run on a server, such as the case if there are ajax calls in javascript files.

Nodejs could have been an alternative, but python provides a simple and fast method to run a server on your machine with a single command line.

Using python3, run this command in the directory of the static files

python -m http.server

If using python2, use

python -m SimpleHTTPServer [port]