Skip to content

Commit ff59221

Browse files
committed
Use Sinatra application as a middleware
1 parent 3aec05a commit ff59221

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config.ru

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ configure do
99
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
1010
end
1111

12-
get '/' do
12+
get '/hi' do
13+
"Hello App!cloud!"
14+
end
15+
16+
get '/counter' do
1317
@counter = REDIS.incr("counter")
1418
haml :counter
1519
end
1620

17-
run Rack::URLMap.new("/" => ShowOff.new, "/counter" => Sinatra::Application)
21+
use Sinatra::Application
22+
run ShowOff.new

views/counter.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
%html
33
%head
44
%title Amazing Counter
5-
%link{:rel => 'stylesheet', :href => 'counter/style.css', :type => 'text/css'}
5+
%link{:rel => 'stylesheet', :href => 'style.css', :type => 'text/css'}
66
%body
77
%p.counter= @counter

0 commit comments

Comments
 (0)