6. sinatraとは?
• rubyのwebフレームワーク
– 簡単にwebアプリケーションが作れる
require
“sinatra”
get
’/hello'
do
“hello”
end
• 起動確認
ruby
hello.rb
19:27:09]
INFO
WEBrick
1.3.1
[2012-‐07-‐10
[2012-‐07-‐10
19:27:09]
INFO
ruby
1.9.3
(2012-‐04-‐20)
[x86_64-‐darwin11.3.0]
==
Sinatra/1.3.2
has
taken
the
stage
on
4567
for
development
with
backup
from
WEBrick
[2012-‐07-‐10
19:27:09]
INFO
WEBrick::HTTPServer#start:
pid=16952
port=4567