Sha256: 01072b60a79e882527d2f765fdcf82c4272af4d144eb88c5c69d05214a03b102
Contents?: true
Size: 902 Bytes
Versions: 18
Compression:
Stored size: 902 Bytes
Contents
# # Usage: # bin/rackup examples/api/memoized.ru -p 9999 # # http://localhost:9999/ # require 'bundler/setup' require 'rack/reloader' require "active_support/notifications" require "flipper/api" require "flipper/adapters/pstore" Flipper.configure do |config| config.adapter { Flipper::Adapters::Instrumented.new( Flipper::Adapters::PStore.new, instrumenter: ActiveSupport::Notifications, ) } end ActiveSupport::Notifications.subscribe(/.*/, ->(*args) { name, start, finish, id, data = args case name when "adapter_operation.flipper" p data[:adapter_name] => data[:operation] end }) Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? } # You can uncomment this to get some default data: # Flipper.enable :logging use Rack::Reloader run Flipper::Api.app { |builder| builder.use Flipper::Middleware::Memoizer, preload: true }
Version data entries
18 entries across 18 versions & 1 rubygems