Joshua Peek 61a41154f7 Make generated Metal bits a pure rack endpoint application (not middleware)
Instead of calling super to pass the request on, return a 404.
The modified app looks like this:

  # app/metal/poller.rb
  class Poller
    def self.call(env)
      if env["PATH_INFO"] =~ /^\/poller/
        [200, {"Content-Type" => "text/html"}, "Hello, World!"]
      else
        [404, {"Content-Type" => "text/html"}, "Not Found"]
      end
    end
  end

But you aren't locked in to just Rails:

  # app/metal/api.rb
  require 'sinatra'
  Sinatra::Application.default_options.merge!(:run => false, :env => :production)
  Api = Sinatra.application unless defined? Api

  get '/interesting/new/ideas' do
    'Hello Sinatra!'
  end
2008-12-17 09:53:56 -06:00
2008-12-07 03:27:53 +01:00
2008-11-18 20:52:07 +01:00
2008-06-22 10:38:25 -07:00
2008-06-22 10:38:25 -07:00
Description
No description provided
85 MiB
Languages
Ruby 97.9%
CSS 1.5%
HTML 0.5%