Files
startusingdocker/swarm/app.py
Guillem Hernandez Sola cc5c9fd797 All files
2018-10-25 16:57:44 +02:00

13 lines
318 B
Python

from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
count = redis.incr('hits')
return 'Hello World! I have been seen {} times.\n'.format(count)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000, debug=True)