Created
August 15, 2018 08:30
-
-
Save hadnazzar/c9d3b81e95d53267bb7ca88d95959e27 to your computer and use it in GitHub Desktop.
Open server at any directory
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}/" && python -m SimpleHTTPServer "$port" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment