Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (18 sloc) 0.436 kb
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
"<html><head><title>Hello from Webmachine</title></head><body>Hello, world!</body></html>"
end
end
App = Webmachine::Application.new do |app|
app.routes do
add [], HelloResource
end
end
App.run
Jump to Line
Something went wrong with that request. Please try again.