Skip to content

Instantly share code, notes, and snippets.

@aliou
Created April 27, 2012 15:59
Show Gist options
  • Save aliou/2510377 to your computer and use it in GitHub Desktop.
Save aliou/2510377 to your computer and use it in GitHub Desktop.
sinatra template app

This is a Sinatra template app.

require 'rubygems'
require 'sinatra'
get '/' do
erb :index
end
get '/index' do
redirect to('/')
end
require './app'
run Sinatra::Application
source :rubygems
gem 'sinatra'
gem 'thin'
GEM
remote: http://rubygems.org/
specs:
daemons (1.1.8)
eventmachine (0.12.10)
rack (1.4.1)
rack-protection (1.2.0)
rack
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
tilt (1.3.3)
PLATFORMS
ruby
DEPENDENCIES
sinatra
thin
<p>This is the home page.</p>
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF=8' />
<title>My new App.</title>
</head>
<body>
<%= yield %>
</body>
</html>
web: bundle exec ruby app.rb -p $PORT
<p>This is the home page.</p>
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF=8' />
<title>My new App.</title>
</head>
<body>
<%= yield %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment