1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails/rack
Joshua Peek 8c3a543664 Introduce Rails Metal
# app/metal/poller.rb
  class Poller < Rails::Rack::Metal
    def call(env)
      if env["PATH_INFO"] =~ /^\/poller/
        [200, {"Content-Type" => "application/json"}, Message.recent.to_json]
      else
        super
      end
    end
  end

* There is a generator to help you get started
    `script/generate metal poller`

* Also, metal bits can be ran standalone with rackup
    `rackup app/metal/poller.rb`
2008-12-16 13:15:06 -06:00
..
debugger.rb Move debugger into middleware 2008-11-25 15:05:07 -06:00
logger.rb Added rack logger middleware that tails the environment log 2008-08-19 00:18:26 -05:00
metal.rb Introduce Rails Metal 2008-12-16 13:15:06 -06:00
static.rb Require rack/utils explicitly 2008-12-03 10:23:58 -06:00