Skip to content

Instantly share code, notes, and snippets.

@jdrew1303
Forked from addyosmani/snippet for someone
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdrew1303/48fe7c97c2f5bb253924 to your computer and use it in GitHub Desktop.
Save jdrew1303/48fe7c97c2f5bb253924 to your computer and use it in GitHub Desktop.
# Start an HTTP server from a directory, optionally specifying the port
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
# Set the default Content-Type to `text/plain` instead of `application/
# And serve everything as UTF-8 (although not technically correct, this
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTP
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment