Module: Roda::RodaPlugins::BridgetownServer::RequestMethods

Defined in:
bridgetown-core/lib/roda/plugins/bridgetown_server.rb

Instance Method Summary collapse

Instance Method Details

#bridgetownObject

Start up the Bridgetown routing system



160
161
162
163
164
165
166
167
168
169
# File 'bridgetown-core/lib/roda/plugins/bridgetown_server.rb', line 160

def bridgetown
  scope.initialize_bridgetown_context
  scope.initialize_bridgetown_root

  base_path = Bridgetown::Current.preloaded_configuration.base_path.delete_prefix("/")
  on(base_path.empty? ? true : base_path) do
    ssg # static file server
    Bridgetown::Rack::Routes.load_all scope
  end
end

#cookiesObject

Monkeypatch Roda/Rack’s Request object so it returns a hash which allows for symbol or dot access



155
156
157
# File 'bridgetown-core/lib/roda/plugins/bridgetown_server.rb', line 155

def cookies
  HashWithDotAccess::Hash.new(_previous_roda_cookies)
end