aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails/metal/templates/metal.rb
blob: 8cc3f1f258a7fd3a719c15dd2c9cd29818df0b46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
# Allow the metal piece to run in isolation
require File.expand_path('../../../config/environment',  __FILE__) unless defined?(Rails)

class <%= class_name %>
  def self.call(env)
    if env["PATH_INFO"] =~ /^\/<%= file_name %>/
      [200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
    else
      [404, {"Content-Type" => "text/html", "X-Cascade" => "pass"}, ["Not Found"]]
    end
  end
end