Skip to content

Instantly share code, notes, and snippets.

@tailhook
Created March 13, 2016 23:53
Show Gist options
  • Select an option

  • Save tailhook/e8989d7ed0767ff753dc to your computer and use it in GitHub Desktop.

Select an option

Save tailhook/e8989d7ed0767ff753dc to your computer and use it in GitHub Desktop.
def main():
sock = http.Http('127.0.0.1', 3000)
rconn = redis.Redis(port=3001)
for req in loop.events():
n = rconn.incr("hello-world-counter")
req.reply(
[200, u"OK"],
{u"Content-Type": b"text/html"},
"Hello page opened {} times".format(n).encode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment