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



157
158
159
160
161
162
163
164
165
166
# File 'bridgetown-core/lib/roda/plugins/bridgetown_server.rb', line 157

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



152
153
154
# File 'bridgetown-core/lib/roda/plugins/bridgetown_server.rb', line 152

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