Created
July 6, 2017 01:54
-
-
Save bennacer860/18eade85bfd9fce9b644db02bcff3260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main < Sinatra::Base | |
get '/' do | |
# make call to the database | |
result = number_of_users | |
"Hello World! #{result[:count]}" | |
end | |
def number_of_users | |
Cache.fetch "number_of_users" do | |
FakeDatabase.connection "select count(*) from users" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment