class Contentful::Bootstrap::Server

Attributes

server[R]

Public Class Methods

new(token) click to toggle source
# File lib/contentful/bootstrap/server.rb, line 85
def initialize(token)
  @server = WEBrick::HTTPServer.new(Port: 5123)
  @server.mount '/', IndexController
  @server.mount '/oauth_callback', OAuthCallbackController
  @server.mount '/save_token', SaveTokenController, token
end

Public Instance Methods

running?() click to toggle source
# File lib/contentful/bootstrap/server.rb, line 100
def running?
  @server.status != :Stop
end
start() click to toggle source
# File lib/contentful/bootstrap/server.rb, line 92
def start
  Thread.new { @server.start }
end
stop() click to toggle source
# File lib/contentful/bootstrap/server.rb, line 96
def stop
  @server.shutdown
end