Skip to content

Instantly share code, notes, and snippets.

@bryanstedman
Created January 7, 2013 19:18
Show Gist options
  • Save bryanstedman/4477605 to your computer and use it in GitHub Desktop.
Save bryanstedman/4477605 to your computer and use it in GitHub Desktop.
Quick local server
Four ways to serve files from the current directory at localhost under port 8000:
http://localhost:8000/
# Python 2.x
python -m SimpleHTTPServer
# Python 3.x
python -m http.server
# Ruby
ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start"
# PHP 5.4.0+
php -S localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment