Skip to content

Commit b1fef09

Browse files
committed
Allow resetting counter
1 parent f7e70b7 commit b1fef09

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

config.ru

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ get '/hi' do
1414
end
1515

1616
get '/counter' do
17-
@counter = REDIS.incr("counter")
17+
@counter = REDIS.incr "counter"
1818
haml :counter
1919
end
2020

21+
get '/counter/reset' do
22+
REDIS.del "counter"
23+
redirect '/counter'
24+
end
25+
2126
use Sinatra::Application
2227
run ShowOff.new

0 commit comments

Comments
 (0)