Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active October 2, 2018 12:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/7713694 to your computer and use it in GitHub Desktop.
Save miguelmota/7713694 to your computer and use it in GitHub Desktop.
Python SimpleHTTPServer alias for .bashrc
# Fires up a web server on localhost:8000
#
# Example:
#
# ~/workspace $ server
# Serving HTTP on 0.0.0.0 port 8000 ...
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}
alias server=server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment