Skip to content

Instantly share code, notes, and snippets.

@ordinz
Created December 7, 2018 21:11
Show Gist options
  • Save ordinz/c9e3273c2a9a6a15f8cb01cdcb4cba60 to your computer and use it in GitHub Desktop.
Save ordinz/c9e3273c2a9a6a15f8cb01cdcb4cba60 to your computer and use it in GitHub Desktop.
Open up a HTTP connection from the current directory
expose_http(){
PORT=8000
URL=http://`hostname`:$PORT
echo
echo Caution: Opening hole to the void.
echo
echo Exposing `pwd` to $URL
echo
{
sleep 1
`open $URL`
}&
ruby -run -ehttpd . -p $PORT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment