Skip to content

Instantly share code, notes, and snippets.

@h-hirai
Created August 28, 2009 05:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h-hirai/176796 to your computer and use it in GitHub Desktop.
Save h-hirai/176796 to your computer and use it in GitHub Desktop.
Starting Webrick
#! /usr/bin/ruby
require 'webrick'
mimetypes = WEBrick::HTTPUtils::DefaultMimeTypes
mimetypes["js"] = "application/x-javascript"
mimetypes["svg"] = "image/svg+xml"
s = WEBrick::HTTPServer.new(:Port => 8000,
:DocumentRoot => Dir::pwd,
:MimeTypes => mimetypes)
trap("INT"){s.shutdown}
s.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment