require 'webmachine' class HelloResource < Webmachine::Resource def last_modified File.mtime(__FILE__) end def encodings_provided { "gzip" => :encode_gzip, "identity" => :encode_identity } end def to_html "Hello from WebmachineHello, world!" end end Webmachine::Dispatcher.add_route([], HelloResource) Webmachine.run