Skip to content

Instantly share code, notes, and snippets.

@waynerobinson
Created September 9, 2016 03:12
Show Gist options
  • Save waynerobinson/f0a2fda953ac312835eb496e8dcd7623 to your computer and use it in GitHub Desktop.
Save waynerobinson/f0a2fda953ac312835eb496e8dcd7623 to your computer and use it in GitHub Desktop.
require 'webrick'
server = WEBrick::HTTPServer.new :Port => 8000
trap 'INT' do server.shutdown end
server.mount_proc '/' do |req, res|
res.body = 'Hello, world!'
end
server.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment