Skip to content

Instantly share code, notes, and snippets.

@mjpitz
Last active August 29, 2015 13:56
Show Gist options
  • Save mjpitz/9164119 to your computer and use it in GitHub Desktop.
Save mjpitz/9164119 to your computer and use it in GitHub Desktop.
Simple servers for command line. Serve html or php scripts with the following commands.
function servephp() {
local port="${1:-8080}"
open "http://localhost:${port}"
php -S localhost:$port
}
function serve() {
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