Skip to content

Instantly share code, notes, and snippets.

@jpsilvashy
Created February 28, 2012 08:24
Show Gist options
  • Save jpsilvashy/1930803 to your computer and use it in GitHub Desktop.
Save jpsilvashy/1930803 to your computer and use it in GitHub Desktop.
simple_server
#! /usr/bin/env ruby
require 'webrick'
root = File.absolute_path(".")
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root
# catch int and shutdown
trap 'INT' do server.shutdown end
server.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment