Skip to content

Instantly share code, notes, and snippets.

@dirkharrington
Created January 14, 2014 14:18
Show Gist options
  • Save dirkharrington/8418973 to your computer and use it in GitHub Desktop.
Save dirkharrington/8418973 to your computer and use it in GitHub Desktop.
Simple functions for serving via http
#!/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