Instance refused connection for node js application

How should I resolve this error. I have successfully deployed my node js application. Have added the secrets as well from .env to fly

cdg [error] instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the they are listening on)

please suggest a way to fix this. Thanks

You are not giving us a lot to go on.

Check your code for something that looks like:

server.listen(3000, () => {
  console.log('Server is listening on port 3000');
});

Or perhaps:

app.listen(3000, () => {
  console.log('Server is listening on port 3000');
});

Does the port specified on those lines match port 3000? If not, adjust fly.toml to match the port you are using.

If it helps to see a node application that works, try this: Vanilla with Candy Sprinkles · The Fly Blog

1 Like

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