bastos (owner)

Fork Of

Revisions

  • 704249 da01 Sat Feb 07 21:47:32 -0800 2009
  • 9c461d da01 Wed Feb 04 04:42:01 -0800 2009
  • f7f600 da01 Wed Feb 04 03:48:40 -0800 2009
  • 5c34d3 da01 Wed Feb 04 03:46:02 -0800 2009
  • a6ac95 da01 Wed Feb 04 03:44:45 -0800 2009
  • 7a1ba9 da01 Wed Feb 04 03:33:16 -0800 2009
  • 6d7934 da01 Wed Feb 04 03:30:23 -0800 2009
  • b9c793 da01 Wed Feb 04 02:25:44 -0800 2009
  • bc16ff da01 Wed Feb 04 02:12:46 -0800 2009
  • 03f6af da01 Wed Feb 04 01:47:22 -0800 2009
gist: 61669 Download_button fork
public
Public Clone URL: git://gist.github.com/61669.git
Embed All Files: show embed
Sinatra-Boilerplate-On-Heroku.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Based on:
# http://github.com/bmizerany/heroku-sinatra-app
# http://www.sinatrarb.com/book.html#heroku
# trial-and-error
#
# I tried using Blake's sample code from github,
# but for some reason my Heroku.com app was running in
# a directory called /mnt. This did not correspond to the
# name of my app. The code below is more explicit when it
# comes to the name of the app file. That is the only difference.
#
# Note: This is for Heroku.com, not Herokugarden.com.
# The difference is that Heroku.com is running the latest Sinatra gem.
# Herokugarden.com is running the older Sinatra gem.
# More info. at this thread:
# http://groups.google.com/group/sinatrarb/browse_thread/thread/1f550adbd57a7805/eb83105300749113?lnk=gst&q=heroku#
 
# ============================================================
# FILE: config/rackup.ru
# ============================================================
require 'rubygems'
require 'sinatra'
 
my_app_root = File.expand_path( File.dirname(__FILE__) + '/..' )
 
set :environment, :production # Don't use :env
set :public, my_app_root + '/public'
 
disable :run, :reload
 
# For this sample, we will name our sinatra start file:
# start_me_up.rb
# But you can name it whatever you want.
require( my_app_root + "/start_me_up.rb" )
 
run Sinatra::Application
 
# ============================================================
# FILE: start_me_up.rb
# ============================================================
require "rubygems"
require "sinatra"
 
configure :production do
  error do
    "Error. Come back later."
  end
 
  not_found do
    "Insert cool 404 content here."
  end
end
 
get '/' do
  %(
Ok... if you see this message,
you are good to go for Sinatra @ The Heroku Nightclub.
)
end
 
__END__
#
# Setup git and install the Heroku gem ("gem install heroku").
# Then:
#
cd myapp
(...make edits...)
git init
git add .
git commit -m "my new app"
heroku create myapp
git remote add heroku git@heroku.com:myapp.git
git push heroku master