Skip to content

Instantly share code, notes, and snippets.

@iphoting
Created July 25, 2012 04:06
Show Gist options
  • Save iphoting/3174326 to your computer and use it in GitHub Desktop.
Save iphoting/3174326 to your computer and use it in GitHub Desktop.
Simple HTTP Server for Ruby
#!/usr/bin/env rackup
#\ -E deployment
# Description:
#
# Start a simple static HTTP server for the current directory.
#
# Prerequisites:
#
# gem install 'rack'
# gem install 'thin' (optional, but for better performance)
#
# Usage:
#
# $ cd web_root/
# $ simple_http_server.ru
#
# For more usage information:
# $ simple_http_server.ru --help
#
use Rack::ContentLength
use Rack::Deflater
use Rack::ConditionalGet
run Rack::Directory.new Dir.pwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment