Advertisement
uopspop

Untitled

Aug 7th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. require 'sinatra'
  2. require 'redis'
  3.  
  4. set :bind, '0.0.0.0'
  5.  
  6. configure do
  7.   $redis = Redis.new(:host => 'redis')
  8. end
  9.  
  10. get '/' do
  11.   count = $redis.incr('count')
  12.  
  13.   "<h1>Hello</h1>"
  14.   "<p>This page has been viewed #{count} times</p>"
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement