Module: Mihari::Commands::Web
- Included in:
- Mihari::CLI::App
- Defined in:
- lib/mihari/commands/web.rb
Overview
Web sub-commands
Class Method Summary collapse
Class Method Details
.included(thor) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mihari/commands/web.rb', line 10 def included(thor) thor.class_eval do desc "web", "Start the web app" method_option :port, type: :numeric, default: 9292, desc: "Port to listen on" method_option :host, type: :string, default: "localhost", desc: "Hostname to listen on" method_option :threads, type: :string, default: "0:3", desc: "min:max threads to use" method_option :verbose, type: :boolean, default: false, desc: "Don't report each request" method_option :worker_timeout, type: :numeric, default: 60, desc: "Worker timeout value (in seconds)" method_option :open, type: :boolean, default: true, desc: "Whether to open the app in browser or not" method_option :env, type: :string, default: "production", desc: "Environment" def web require "mihari/web/application" ENV["APP_ENV"] ||= ["env"] Mihari::Web::App.run!( port: ["port"], host: ["host"], threads: ["threads"], verbose: ["verbose"], worker_timeout: ["worker_timeout"], open: ["open"] ) end end end |