Sha256: 3c744c7396443810c4e4aba8423ff1e29202eb0edd5612b2a7d1dbd1ceddce7a
Contents?: true
Size: 541 Bytes
Versions: 11
Compression:
Stored size: 541 Bytes
Contents
require 'noumenon' class Noumenon::Spec::ExampleApp def initialize(options = {}) @options = { message: "This is a mounted application" }.merge(options.symbolize_keys) end def call(env) case env["PATH_INFO"] when "/" respond 200, "<h1>#{@options[:message]}</h1>" when "/sub" respond 200, "<h1>This is a sub-page</h1>" else respond 404, "Page Not Found" end end def respond(status, content) [ status, { "Content-Type" => "text/html" }, StringIO.new(content) ] end end
Version data entries
11 entries across 11 versions & 1 rubygems