Last active
February 10, 2019 22:37
-
-
Save addyosmani/5926131 to your computer and use it in GitHub Desktop.
Snippet for someone
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
# 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