Class: WebTranslateItServer

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/web_translate_it_server.rb', line 7

def config
  @config
end

Class Method Details

.start(host, port) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/web_translate_it_server.rb', line 48

def self.start(host, port)
  puts "Starting wti server on port #{port}..."
  Dir::mkdir('log') unless FileTest::directory?('log')
  logger = ::File.open("log/webtranslateit.log", "a+")
  STDOUT.reopen(logger)
  STDERR.reopen(logger)
  WebTranslateItServer.run! :host => host, :port => port
end