Last active
December 12, 2020 22:42
-
-
Save triangletodd/3254da419c9e95f8294d to your computer and use it in GitHub Desktop.
Ruby HTTP Server
This file contains hidden or 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 'pry' | |
require 'rack' | |
require 'thin' | |
class TestingServer | |
def self.start | |
builder = Rack::Builder.new { run Rack::Directory.new('') } | |
Rack::Handler::Thin.run builder, :port => 3000 | |
end | |
end | |
Thread.abort_on_exception = true | |
@testing_server = Thread.new { TestingServer.start } | |
binding.pry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment