Class: Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/server.rb

Class Method Summary collapse

Class Method Details

.startObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/server.rb', line 61

def self.start
  unless Server.running?
    thread = Thread.new do
      puts "Starting Sinatra"
      Server.run!
      puts "Stopping crawl..."
      ## we need to manually kill the main thread as sinatra traps the interrupts
      Thread.main.kill
    end
  end    
end