Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created August 15, 2017 19:46
Show Gist options
  • Save jwkidd3/33af238c017044baff47cc5a57934778 to your computer and use it in GitHub Desktop.
Save jwkidd3/33af238c017044baff47cc5a57934778 to your computer and use it in GitHub Desktop.
from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'Hello World! I have been seen %s times.' % redis.get('hits')
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment