-
-
Save iqbmo04/0578f8857e15287c527b7174a09e1e20 to your computer and use it in GitHub Desktop.
Shell function to start a server
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
# 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