Created
June 15, 2018 13:21
-
-
Save sincarne/5778cd2be2fb47ddc34e3b7aef8da5c9 to your computer and use it in GitHub Desktop.
Shell function to start a server
This file contains hidden or 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
# Add this to your .profile | |
# Typing `serve` with no arguments will start the PHP inbuilt | |
# server, listening on port 8000. | |
# If you provide an argument, that is assumed to be the port | |
# on which to listen. | |
function serve() { | |
if [ $# -eq 0 ]; then | |
php -S localhost:8000 | |
else | |
php -S localhost:"$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment