Sha256: 11bf50ab833355f68ac48b27845f87aa0a54457493dc0bcb0e15b261e15d390a

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Commands
    module Web
      def self.included(thor)
        thor.class_eval do
          desc "web", "Launch the web app"
          method_option :port, type: :numeric, default: 9292
          method_option :host, type: :string, default: "localhost"
          def web
            port = options["port"].to_i || 9292
            host = options["host"] || "localhost"

            load_configuration

            # set rack env as production
            ENV["RACK_ENV"] ||= "production"

            Mihari::App.run!(port: port, host: host)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mihari-3.4.1 lib/mihari/commands/web.rb
mihari-3.4.0 lib/mihari/commands/web.rb
mihari-3.3.0 lib/mihari/commands/web.rb