Class: TRMNLP::Commands::Serve

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/trmnlp/commands/serve.rb', line 9

def call
  context.validate!
  
  # Must come AFTER parsing options
  require_relative '../app'

  # Now we can configure things
  App.set(:context, context)
  App.set(:bind, options.bind)
  App.set(:port, options.port)

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