HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 13
¡Hola, Mundo!
Slide 28
Slide 28 text
POST /hola HTTP/1.1
Content-Type: application/x-www-form-
urlencode
Content-Length: 10
name=inkel
Slide 29
Slide 29 text
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 13
¡Hola, inkel!
Slide 30
Slide 30 text
Sinatra
http://www.sinatrarb.com/
Slide 31
Slide 31 text
require "sinatra"
!
get "/hola" do
"¡Hola, Mundo!\r\n"
end
!
post "/hola" do
name = params[:name]
"¡Hola, #{name}!\r\n"
end
Slide 32
Slide 32 text
The Guide to Cuba
http://theguidetocuba.io/
Slide 33
Slide 33 text
require "cuba"
!
Cuba.define do
on "hola" do
on get do
res.write "¡Hola, Mundo!\r\n"
end
!
on post, param("name") do |name|
res.write "¡Hola, #{name}!\r\n"
end
end
end
Slide 34
Slide 34 text
“No hay preguntas
tontas, sino tontos que
no preguntan”