Skip to content

Instantly share code, notes, and snippets.

@hadnazzar
Created August 15, 2018 08:30
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 hadnazzar/c9d3b81e95d53267bb7ca88d95959e27 to your computer and use it in GitHub Desktop.
Save hadnazzar/c9d3b81e95d53267bb7ca88d95959e27 to your computer and use it in GitHub Desktop.
Open server at any directory
# 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