Created
January 14, 2014 14:18
-
-
Save dirkharrington/8418973 to your computer and use it in GitHub Desktop.
Simple functions for serving via http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Starts an HTTP server. | |
# With no args port 8080 is bound to the CWD | |
serve() { | |
if [ -n "$2" ]; then pushd $2; fi | |
python -m SimpleHTTPServer ${1:-8080} & | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment