Sha256: 39935ca441ea4aa1734f349ca84ba7a7dccda80e41ae30a96538ff018d5b98af

Contents?: true

Size: 860 Bytes

Versions: 17

Compression:

Stored size: 860 Bytes

Contents

# frozen_string_literal: true

# Rack
require "rack"
require "rack/session"
require "rackup"

require "rack/handler/puma"

# Sidekiq
require "sidekiq/web"

module Miteru
  module Web
    class App
      class << self
        def instance
          Rack::Builder.new do
            use Rack::Session::Cookie, secret: SecureRandom.hex(32), same_site: true, max_age: 86_400

            map "/" do
              run Sidekiq::Web
            end

            run App.new
          end.to_app
        end

        def run!(port: 9292, host: "localhost", threads: "0:3", verbose: false, worker_timeout: 60, open: true)
          Rackup::Handler::Puma.run(
            instance,
            Port: port,
            Host: host,
            Threads: threads,
            Verbose: verbose,
            worker_timeout:
          )
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
miteru-3.0.1 lib/miteru/web/application.rb
miteru-3.0.0 lib/miteru/web/application.rb
miteru-2.4.0 lib/miteru/web/application.rb
miteru-2.3.2 lib/miteru/web/application.rb
miteru-2.3.1 lib/miteru/web/application.rb
miteru-2.3.0 lib/miteru/web/application.rb
miteru-2.2.4 lib/miteru/web/application.rb
miteru-2.2.3 lib/miteru/web/application.rb
miteru-2.2.2 lib/miteru/web/application.rb
miteru-2.2.1 lib/miteru/web/application.rb
miteru-2.2.0 lib/miteru/web/application.rb
miteru-2.1.1 lib/miteru/web/application.rb
miteru-2.1.0 lib/miteru/web/application.rb
miteru-2.0.3 lib/miteru/web/application.rb
miteru-2.0.2 lib/miteru/web/application.rb
miteru-2.0.1 lib/miteru/web/application.rb
miteru-2.0.0 lib/miteru/web/application.rb