Skip to content

Instantly share code, notes, and snippets.

@gouf
Last active December 20, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gouf/6054586 to your computer and use it in GitHub Desktop.
Save gouf/6054586 to your computer and use it in GitHub Desktop.
Simple Webserver, Webrick
require 'webrick'
include WEBrick
root = File.expand_path(File.dirname($0))
server = WEBrick::HTTPServer.new :Port => 3000, :DocumentRoot => root
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