run Proc.new { |env| ['200', {'Content-Type' => 'text/html'}, ['get rack\'d']] } Responds to #call Much HTTP Status code Such Headers Response body Wow Run
require 'erb' class MyRackApp def initialize @april_fools = Time.now.strftime('%m%d') == '0401' end def call(_env) ['200', {'Content-Type' => 'text/html'}, view] end def view [ERB.new(template).result(binding)] end def template File.open('index.html.erb', 'r').read end end