Skip to content

Instantly share code, notes, and snippets.

@davelnewton
Forked from JeffreyWay/gist:1525217
Created February 27, 2014 17:17
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 davelnewton/9254607 to your computer and use it in GitHub Desktop.
Save davelnewton/9254607 to your computer and use it in GitHub Desktop.
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@davelnewton
Copy link
Author

server() {
  open "http://localhost:${1}" && python -m SimpleHTTPServer $1
}

@davelnewton
Copy link
Author

function server() { # via https://gist.github.com/1525217
  local host=`hostname`
  local port="${1:-8888}"
  (sleep 1 && open "http://${host}:${port}/")&
  python -m SimpleHTTPServer "$port"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment