Skip to content

@Poincare /gist:3694526
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require "cuba"
Cuba.use Rack::Session::Cookie
Cuba.define do
on get do
on "hello" do
res.write "Hello world!"
end
on "echo/:string" do |string|
res.write string
end
on "print", param("p") do |string|
res.write string
end
on root do
res.redirect "/hello"
end
end
on.post do
on "api" do
res.write '{"error" : "no api yet"}'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.