Class: RailsEventStore::Browser::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_event_store/browser/engine.rb

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rails_event_store/browser/engine.rb', line 6

def self.call(env)
  warn <<~EOW
    RailsEventStore::Browser::Engine has been deprecated.

    This gem will be discontinued on next RailsEventStore release. 
    Please use 'ruby_event_store-browser' gem from now on.

    In Gemfile:

       gem 'ruby_event_store-browser', require: 'ruby_event_store/sbrowser/app'


    In routes.rb:

      mount RubyEventStore::Browser::App.for(
        event_store_locator: -> { Rails.configuration.event_store },
        host: 'http://localhost:3000',
        path: '/res'
      ) => '/res' if Rails.env.development?
  EOW

  request = Rack::Request.new(env)
  app = RubyEventStore::Browser::App.for(
    event_store_locator: -> { Rails.configuration.event_store },
    host: request.base_url,
    path: request.script_name
  )
  app.call(env)
end