import logging | |
from flask import Flask | |
from flask_caching import Cache | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def execute(event, context): | |
logger.info("Received Event: %s", event) | |
config = { | |
"DEBUG": True, # some Flask specific configs | |
"CACHE_TYPE": "SimpleCache", # Flask-Caching related configs | |
"CACHE_DEFAULT_TIMEOUT": 300 | |
} | |
app = Flask(__name__) | |
# tell Flask to use the above defined config | |
app.config.from_mapping(config) | |
cache = Cache(app) | |