Class: Spanx::CLI::Api

Inherits:
Spanx::CLI show all
Defined in:
lib/spanx/cli/api.rb

Instance Attribute Summary

Attributes inherited from Spanx::CLI

#args

Instance Method Summary collapse

Methods included from Helper::Subclassing

included

Methods included from Helper::Exit

#error_exit_with_msg, #help_exit

Instance Method Details

#run(argv = ARGV) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/spanx/cli/api.rb', line 55

def run(argv = ARGV)
  generate_config(argv)

  puts "Starting Spanx API on #{config[:host]}:#{config[:port]}.."

  Daemonize.daemonize if config[:daemonize]

  Spanx::API::Machine.configure do |c|
    c.port = config[:port]
    c.ip = config[:host]
  end

  Spanx::API::Machine.run
end