Created
December 14, 2012 04:18
-
-
Save lhitchon/4282662 to your computer and use it in GitHub Desktop.
Modular Sinatra app deployed to AppFog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
class MyApp < Sinatra::Application | |
get '/' do | |
"<!doctype><html><head><style>body{ font-family: sans-serif; width: 800px; margin: 40px auto; }</style></head><body>" + | |
"<h1>This is a Modular Sinatra App</h1>" + | |
"</body></html>" | |
end | |
get '/about' do | |
"<!doctype><html><head><style>body{ font-family: sans-serif; width: 800px; margin: 40px auto; }</style></head><body>" + | |
"<h1>This is the About Page</h1>" + | |
"</body></html>" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require ::File.join( ::File.dirname(__FILE__), 'app') | |
run MyApp.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> af push rackup | |
Would you like to deploy from the current directory? [Yn]: | |
Detected a Rack Application, is this correct? [Yn]: | |
1: AWS US East - Virginia | |
2: AWS EU West - Ireland | |
3: AWS Asia SE - Singapore | |
4: Rackspace AZ 1 - Dallas | |
5: HP AZ 2 - Las Vegas | |
Select Infrastructure: 1 | |
Application Deployed URL [rackup.aws.af.cm]: | |
Memory reservation (128M, 256M, 512M, 1G, 2G) [128M]: | |
How many instances? [1]: | |
Create services to bind to 'rackup'? [yN]: | |
Would you like to save this configuration? [yN]: | |
Creating Application: OK | |
Uploading Application: | |
Checking for available resources: OK | |
Packing application: OK | |
Uploading (1K): OK | |
Push Status: OK | |
Staging Application 'rackup': OK | |
Starting Application 'rackup': OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'thin' | |
gem 'rack' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment