mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
61a41154f7
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 |
||
---|---|---|
.. | ||
generators | ||
scripts | ||
base.rb | ||
commands.rb | ||
generated_attribute.rb | ||
lookup.rb | ||
manifest.rb | ||
options.rb | ||
scripts.rb | ||
secret_key_generator.rb | ||
simple_logger.rb | ||
spec.rb |