why can't i deploy react flask app on heroku?

前端 未结 1 527
独厮守ぢ
独厮守ぢ 2021-01-27 14:35

Newbie here again asking another question. This time is more about Heroku itself. So, I have a project built with react for the main front-end and Flask as an Internal API. So f

相关标签:
1条回答
  • 2021-01-27 15:04

    The application needs to bind to the port provided by Heroky via the PORT environment variable

    app.run(host='0.0.0.0', debug=False, port=int(os.environ.get("PORT", 5000)))
    

    On you local it will use the default 5000, but on Heroku it will bind to PORT

    0 讨论(0)
提交回复
热议问题