Last active
August 29, 2015 13:56
-
-
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.
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
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