-
Notifications
You must be signed in to change notification settings - Fork 0
Minimal Sinatra Example App
GavinJoyce edited this page Mar 17, 2013
·
3 revisions
View the source: https://github.com/RestPack/sample-apps/tree/master/sinatra-sample
require 'sinatra'
require 'restpack-web'
class App < Sinatra::Base
include RestPack::Web::Sinatra::App
get '/' do
erb :index
end
end
<div>
Welcome to the sample RestPack Sinatra app
<hr />
<% if @restpack.user %>
<h1>Hi <%= @restpack.user['name'] %></h1>
<a href="<%= @restpack.logout_url() %>">Logout</a>
<% else %>
Login with :
<a href="<%= @restpack.login_url(:twitter) %>">Twitter</a> |
<a href="<%= @restpack.login_url(:google_oauth2) %>">Google</a>
<% end %>
<hr />
<%= Maruku.new(@restpack.debug_info).to_html %>
</div>
