Skip to content

Instantly share code, notes, and snippets.

@lushone
Created April 5, 2013 09:59
Show Gist options
  • Save lushone/5318112 to your computer and use it in GitHub Desktop.
Save lushone/5318112 to your computer and use it in GitHub Desktop.
Bash function to call a python HTTP server instead of typing out the long winded method. Includes support for passing in port numbers. Port 8000 by default, obviously.
httpserver() {
portNum=$1
if [ -z "$1" ]
then
python -m SimpleHTTPServer 8000
else
python -m SimpleHTTPServer $portNum
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment