我正在尝试在Microsoft Azure上托管web应用程序。该应用程序用于聊天机器人,并使用Flask和Twilio在Python中进行编码。联机查看网页时-@app.route(“/”)-显示正确。但是当通过Twilio-@app.route('/bot',methods=['GET',POST'])发送消息时,它返回一个502错误。Azure应用程序日志中未显示任何内容
# tester to see response
@app.route("/")
def hello():
return "Hello world!"
# actual bot logic
@app.route('/bot', methods=['GET', 'POST'])
def bot():
resp = MessagingResponse()
# bot logic
return str(resp)
我应该注意的是,当运行pythonywhere或本地主机时,一切都按照预期运行。来自Twilio的错误消息为
Twilio was unable to fetch content from: http://gbot->initial.azurewebsites.net/bot
Error: Total timeout is triggered. Configured tt is 15000ms and we attempted 1 time(s)
Remote Host: gbot-initial.azurewebsites.net
Request Method: POST
Request URI: http://gbot-initial.azurewebsites.net/bot
URL Fragment: true
我已经用尽了我的资源,希望在这件事上能得到任何帮助
我发现问题出在我的数据库连接上。我不认为这是我所有不幸的结束,但现在是。谢谢你的帮助
相关问题 更多 >
编程相关推荐