这是我的app.py:
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET'])
def test_backend():
return "This is the test function for backend without lambda"
if __name__ == '__main__':
app.run(debug=True)
和event_lambda.py中的lambda_handler:
def lambda_handler(event=None, context=None):
""" This lambda triggers other supporting functions """
return "This lambda handler triggers other functions "
我试图通过zappa_settings.json中的以下事件调用lambda函数
"events": [{
"function": "backend.event_lambda.lambda_handler",
"expression": "cron(0 9 1 * ? *)"
}],
但是它只会从app.py返回“这是没有lambda的后端的测试功能”。仅当我使用以下命令手动调用lambda函数时:
zappa invoke backend.event_lambda.lambda_handler
如何设置zappa直接调用lambda函数?