def hello_cats()

in terraform-serverless/service/app.py [0:0]


def hello_cats():
    if not BUCKET_NAME:
        return flask.render_template_string(
            "Missing environment variable: BUCKET_NAME."
        )

    if not FUNCTION_NAME:
        return flask.render_template_string(
            "Missing environment variable: FUNCTION_NAME."
        )

    cats = get_cats(BUCKET_NAME)
    have_cat = any([c["data"]["is_cat"] for c in cats])
    return flask.render_template("cats.html", cats=cats, have_cat=have_cat)