Skip to content

Instantly share code, notes, and snippets.

@triangletodd
Last active December 12, 2020 22:42
Show Gist options
  • Save triangletodd/3254da419c9e95f8294d to your computer and use it in GitHub Desktop.
Save triangletodd/3254da419c9e95f8294d to your computer and use it in GitHub Desktop.
Ruby HTTP Server
#!/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