12. .
Create App on Heroku
.
before create, you need:
• git
• sign up on heroku website
• public key placed in /.ssh/
. .
@yinhm Ruby PaaS: Heroku 12/18
13. .
Example App
.
.
Twitter API Proxy
..
r e q u i r e ' http '
r e q u i r e ' reverse_proxy '
use Rack : : ReverseProxy do
# Forward the path /* to h t t p s : / / a p i . t w i t t e r . com/*
r e v e r s e _ p r o x y '/ s e a r c h ' , ' h t t p : / / s e a r c h . t w i t t e r . com/ s e a r c h '
r e v e r s e _ p r o x y ' / ' , ' h t t p s : / / a p i . t w i t t e r . com/ '
end
app = proc do | env |
[ 200 , { ' Content−Type ' = ' t e x t / p l a i n ' } , "b" ]
>
end
run app
.
Just released twiap as open source!
. .
@yinhm Ruby PaaS: Heroku 13/18
14. .
Example: deploy
.
$ g i t c l o n e h t t p : / / g i t h u b . com/yinhm/ twiap
$cd twiap
$heroku c r e a t e
C r e a t i n g glowing−water − 3 4 . . . done
Created h t t p : / / glowing−water −34. heroku . com/ | g i t @ h e r o k u . com : glowing−water −34. g i t
G i t remote heroku added
$ g i t push heroku master
$heroku open
. .
@yinhm Ruby PaaS: Heroku 14/18
15. .
Pros
.
• No lock in, Heroku based on open-source mostly
• Dead simple deployment
• Easy scaling
• 1 dynos for free!
• Custom domain for free
. .
@yinhm Ruby PaaS: Heroku 15/18
16. .
Crons
.
• 5M DB space limit
• Need credit card to enable some free features
• No public IP(could get blocked in china, you know the
risk)
. .
@yinhm Ruby PaaS: Heroku 16/18
18. .
About
.
Created in A E using the beamer class, TeX Live and Emacs.
L X
T
Published under the Creative Commons Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
by @yinhm
http://yinhm.appspot.com
Document version June 7, 2010
. .
@yinhm Ruby PaaS: Heroku 18/18