Python Flask Web API [Heroku]: It runs locally but shows Application Error when deployed

前端 未结 1 1480
礼貌的吻别
礼貌的吻别 2021-01-14 06:59

I have done a search on StackOverflow looking for an answer that will help me to get my Web API working, but somehow, I still don\'t have the answer that I need. I have foll

相关标签:
1条回答
  • 2021-01-14 07:37

    Looks like the Heroku load balancer cannot reach your application because it listens on localhost only (IP address 127.0.0.1). Moreover, Heroku allocates port numbers dynamically and assigns the current value to the PORT environment variable.

    Try the following Procfile instead:

    web: gunicorn --bind 0.0.0.0:$PORT main-api:app
    
    0 讨论(0)
提交回复
热议问题