Class: TRMNLP::Commands::Serve

Inherits:
Base
  • Object
show all
Defined in:
lib/trmnlp/commands/serve.rb

Defined Under Namespace

Classes: Options

Instance Method Summary collapse

Methods inherited from Base

#initialize, options_from, run

Constructor Details

This class inherits a constructor from TRMNLP::Commands::Base

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/trmnlp/commands/serve.rb', line 14

def call
  context.validate!
  report_form_field_warnings

  # Must come AFTER parsing options
  require_relative '../app'

  # Now we can configure things
  App.set(:context, context)
  App.set(:browser_pool, BrowserPool.new(driver_factory: method(:build_firefox_driver)))
  App.set(:bind, options.bind)
  App.set(:port, options.port)
  permit_all_hosts if codespaces?

  # Finally, start the app!
  App.run!
end