Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet for someone
# 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