Skip to content

Instantly share code, notes, and snippets.

@ryantate13
Created May 7, 2020 06:17
Show Gist options
  • Save ryantate13/4e97129bff63d8d758aa4db7648e8a90 to your computer and use it in GitHub Desktop.
Save ryantate13/4e97129bff63d8d758aa4db7648e8a90 to your computer and use it in GitHub Desktop.
`serve` zsh alias
serve () {
local port="${2:-80}"
port=$(echo $port | sed s/://g)
echo now serving traffic on http://localhost:$port
sudo docker run -it --rm -v $(realpath $1):/usr/share/nginx/html -p "$port":80 nginx:alpine
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment