INNER CODE UNIT · Python

hello

institutohumai/cursos-python · PracticasDeDesarrollo/4_Desarrollo_IV/storage-compose/flask-redis/app.py:10

def hello():
	try:
		visits = cache.incr("counter")
	except redis.RedisError:
		print('Cant connect to Redis')
		visits = "NaN"

	return jsonify(message=f"Hello! I'm inside a container. You have called me {visits} times. ")

if __name__ == '__main__':    
    app.run(host='0.0.0.0', debug=True)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…