Port Binding -- what am I doing wrong?

In my python code I’ve got this code going trying to run socket mode with slack bolt.

if name == “main”:
from threading import Thread

def run_slack_app():
    SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start()

flask_app.run(host='', port=int(os.environ.get("PORT", 3000)))

However everytime I deploy I get this message:

==> All detected ports bound to, localhost instead of, continuing to scan for open ports…

==> See the docs on specifying a port: Web Services | Render Docs

What am I doing wrong? Thanks a lot.


Your code snippet references Slacks Socket Mode, which notes:

Socket Mode allows your app to use the Events API and interactive features—without exposing a public HTTP Request URL.

So it looks like you’re actually trying to deploy a bot that doesn’t have/need a public-facing URL.

That would point to using a Background Worker if you follow the Which service type is right for my app? flowchart in the docs.


wow, incredible. Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.