Q: Same route of flask server works fine but gives http 503 error when deployed to heroku I have written a flask server. One of the routes is to verify the user email. When I locally run the server and test that route, it works just fine. But when I deploy the server to heroku and test hit the same route, it gives the

Request failed with status code 503

Here is the code for that route
class ActivateUserAccount(Resource):
def post(self):
    try:
        data = request.json
        user = UserTable.find_one({"id": data["id"]})
        if user:
            UserTable.update_one(
                {"id": data["id"]},
                {"$set": {"verified": True}}
            )
            retJson = {
                "status": 200,
                "message": "Your email address has been verified successfully!"
            }
            return jsonify(retJson)
        else:
            retJson = {
                "status": 500,
                "message": "An error occurred while verifying your email address!"
            }
            return jsonify(retJson)
    except Exception as err:
        retJson = {
            "status": 500,
            "message": str(err)
        }
        return jsonify(retJson)

