Last active
December 20, 2015 02:09
-
-
Save gouf/6054586 to your computer and use it in GitHub Desktop.
Simple Webserver, Webrick
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
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