Last active
October 18, 2019 12:35
-
-
Save judepereira/c45f9080def481c0917af77c6b9e9d11 to your computer and use it in GitHub Desktop.
A simple story in Storyscript which prints a the page load 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
http server as server | |
when server listen path: "/" as req | |
current = (redis get key: "count").result | |
if current == null | |
current = 0 | |
current = current + 1 | |
redis set key: "count" value: current | |
req write content: "This page has loaded {current} times.<br>Powered by https://gist.github.com/judepereira/c45f9080def481c0917af77c6b9e9d11" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment