Created
May 23, 2019 14:42
-
-
Save emmiep/c0719a834a8e0cc254a51e76d020dc69 to your computer and use it in GitHub Desktop.
Crystal session counter
This file contains hidden or 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
| get "/" do |env| | |
| count = env.session.int?("count") | |
| count = 0 unless count | |
| env.session.int("count", count+1) | |
| "Count = #{count}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment