我正在尝试运行一个简单的服务器
from klein import Klein
app = Klein()
@app.route("/")
def hello(request):
return "Hello World!"
if __name__ == "__main__":
run("localhost", 8080)
我使用 Zappa 将其打包并上传到 AWS Lambda,悬停在调用端点后我得到了这个,知道为什么吗?
"{'message': 'An uncaught exception happened while servicing this request. You can investigate this with the `zappa tail` command.', 'traceback': ['Traceback (most recent call last):\\n', ' File \"/var/task/handler.py\", line 452, in handler\\n response = Response.from_app(self.wsgi_app, environ)\\n', ' File \"/var/task/werkzeug/wrappers.py\", line 939, in from_app\\n return cls(*_run_wsgi_app(app, environ, buffered))\\n', ' File \"/var/task/werkzeug/test.py\", line 923, in run_wsgi_app\\n app_rv = app(environ, start_response)\\n', ' File \"/var/task/zappa/middleware.py\", line 70, in __call__\\n response = self.application(environ, encode_response)\\n', \"TypeError: 'Klein' object is not callable\\n\"]}"