Class: Pact::App

Inherits:
Thor
  • Object
show all
Defined in:
lib/pact/app.rb

Instance Method Summary collapse

Instance Method Details

#serviceObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pact/app.rb', line 15

def service
  service_options = {}
  if options[:log]
    log = File.open(options[:log], 'w')
    log.sync = true
    service_options[:log_file] = log
  end
  port = options[:port] || FindAPort.available_port
  mock_service = Consumer::MockService.new(service_options)
  Thin::Server.start("0.0.0.0", port, mock_service)
end