Created
February 28, 2012 08:24
-
-
Save jpsilvashy/1930803 to your computer and use it in GitHub Desktop.
simple_server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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