Mais conteúdo relacionado Semelhante a Rack Middleware (20) Mais de LittleBIGRuby (10) Rack Middleware9. Engine Yard Solo
“The platform for
on-demand management of your
Ruby on Rails application
in the cloud.”
17. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
18. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
19. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
20. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
21. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
22. if ($cgi->param(‘action’) eq ‘all’) {
my $sql = “select * from customer”;
my $rows =
$dbh->selectall_arrayref($sql);
if (@$rows) {
print “<table border=1>” .
“<th>name</th>” .
...
54. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
55. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
56. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
57. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
58. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
59. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
60. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
61. run lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
66. class App
def call(env)
[200, {...}, [...]]
end
end
70. lambda { |env|
[
200,
{
‘Content-Type’ => ‘text/plain’,
‘Content-Length’ => ‘5’
},
[‘Hello’]
]
}
91. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
92. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
93. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
94. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
95. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
106. class App
def call(env)
[200, {...}, [...]]
end
end
107. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
108. class GoSlower
def initialize(app)
@app = app
end
def call(env)
sleep(1)
@app.call(env)
end
end
128. Browser
{...}
OAuth OpenID Service
155. map “/” do
run Blog::Public
end
map “/db” do
run Blog::DBAdmin
end
165. app1 = lambda { ... }
app2 = lambda { ... }
run Rack::Cascade.new([app1, app2])
167. class X < Sinatra::Base
get ‘/what’ do
‘what’
end
end
Rails::Initializer.run do |config|
config.use.middleware ‘X’
end