18 lines
346 B
Ruby
18 lines
346 B
Ruby
require 'roda'
|
|
require 'json'
|
|
|
|
class SecureApp < Roda
|
|
route do |r|
|
|
r.on "note" do
|
|
r.get String do |id|
|
|
response['Content-Type'] = 'application/json'
|
|
{ id: id, content: "This is a secure note #{id}" }.to_json
|
|
end
|
|
end
|
|
|
|
r.get "status" do
|
|
{ status: "You are authenticated" }.to_json
|
|
end
|
|
end
|
|
end
|
|
|