Marked as helpful by the asker
Two things in that line:
'localhost'means only processes inside the container can reach it. Render's router is outside, so it sees nothing. Bind to all interfaces.- Render tells you which port to use via
PORT. Read it instead of hardcoding.
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => console.log(`Listening on ${port}`));Then remove the PORT you set manually, let Render inject it.
deployed, live. chatgpt wrote 'localhost' in every example it gave me rocco · edited
Same issue with uvicorn defaulting to 127.0.0.1, for the Python folks. grace_mw · edited
Same root cause on Railway and Fly, for anyone searching. anjali_p · edited