Module: Navigable::Server

Defined in:
lib/navigable/server.rb,
lib/navigable/server/cors.rb,
lib/navigable/server/router.rb,
lib/navigable/server/request.rb,
lib/navigable/server/version.rb,
lib/navigable/server/endpoint.rb,
lib/navigable/server/response.rb,
lib/navigable/server/parsers/json.rb,
lib/navigable/server/parsers/null.rb,
lib/navigable/server/rack_adapter.rb,
lib/navigable/server/parsers/factory.rb,
lib/navigable/server/endpoint_command.rb

Defined Under Namespace

Modules: Endpoint, EndpointCommand, Parsers Classes: CORS, RackAdapter, Request, Response, Router

Constant Summary collapse

BODY_PARSERS =
{
  'application/json' => proc { |data| JSON.parse(data) }
}.freeze
VERSION =
"0.8.0"

Class Method Summary collapse

Class Method Details

.add_endpoint(**kwargs) ⇒ Object



36
37
38
# File 'lib/navigable/server.rb', line 36

def self.add_endpoint(**kwargs)
  router.add_endpoint(**kwargs)
end

.rack_appObject



29
30
31
32
33
34
# File 'lib/navigable/server.rb', line 29

def self.rack_app
  @server ||= Rack::Builder.new(Server.router) do
    use Navigable::Server::CORS::Middleware
    use Rack::AbstractFormat
  end
end

.routerObject



40
41
42
# File 'lib/navigable/server.rb', line 40

def self.router
  @router ||= Router.new
end