Sha256: 3684adb4d008c9531491bdd1b2ee07a610da14c0b6b4bce95514ee979e5072ba
Contents?: true
Size: 820 Bytes
Versions: 1
Compression:
Stored size: 820 Bytes
Contents
require 'lite_cable' require 'lite_cable/server' require 'puma' 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 @rack_app ||= Rack::Builder.new do map '/' do use LiteCable::Server::Middleware, connection_class: 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.11 | lib/rubrowser/server.rb |