mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 02:38:07 +02:00
Added Flask/Redis
Signed-off-by: ajeetraina <ajeetraina@gmail.com>
This commit is contained in:
parent
99d423e7dd
commit
6d2816541c
17 changed files with 36 additions and 85 deletions
15
flask-redis/app.py
Normal file
15
flask-redis/app.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
# compose_flask/app.py
|
||||
from flask import Flask
|
||||
from redis import Redis
|
||||
|
||||
app = Flask(__name__)
|
||||
redis = Redis(host='redis', port=6379)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
redis.incr('hits')
|
||||
return 'This webpage has been viewed %s time(s).' % redis.get('hits')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug=True)
|
Loading…
Add table
Add a link
Reference in a new issue