Last Updated: February 25, 2016
·
900
· pr3ssh

Run a server locally with only one command

I normally write static code for projects (HTML5 & noCMS paradigm). That's the reason why I need a basic server to run my projects. It's very easy to put a NodeJS file into the folder (if you have NodeJS installed yet) but if you are a Linux user, you can simply run this command:

python -m SimpleHTTPServer

Or, like I did, you can put this command into .bash_profile file:

alias startserver='python -m SimpleHTTPServer'

With the last command you will only have to run startserver on terminal next time you want to run a server locally for static pages.