Sha256: 63c541a769857b1c40ab12fdfe8d9691d039e2075738b46bfd87db667159233e
Contents?: true
Size: 863 Bytes
Versions: 1
Compression:
Stored size: 863 Bytes
Contents
require 'lite_cable' require 'lite_cable/server' require 'puma/configuration' require 'puma/launcher' require 'rubrowser/connection' module Rubrowser class Server def initialize(port: 8080) @port = port end def run launcher.run end private attr_reader :port def launcher @launcher ||= Puma::Launcher.new(conf) end def conf @conf ||= Puma::Configuration.new do |user_config| user_config.threads(1, 1) user_config.workers 1 user_config.port port user_config.app(rack_app) end end def rack_app @app ||= Rack::Builder.new do map '/' do use LiteCable::Server::Middleware, connection_class: Rubrowser::Connection run proc { |_| [200, { 'Content-Type' => 'text/plain' }, ['OK']] } end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubrowser-2.7.1 | lib/rubrowser/server.rb |