class Ruboty::Router::Server

Public Class Methods

app(robot) click to toggle source
# File lib/ruboty/router/server.rb, line 5
def app(robot)
  routes = Ruboty::Router.routers.inject({}) { |result, router| result.merge!(router.new(robot).call) }
  Rack::URLMap.new(routes)
end
start(robot) click to toggle source
# File lib/ruboty/router/server.rb, line 10
def start(robot)
  Thread.new do
    Rack::Server.start(
      app: app(robot),
      Port: Ruboty::Router::RUBOTY_ROUTER_PORT,
      Host: '0.0.0.0'
    )
  end
end