Report this

What is the reason for this report?

Why can't I access my app externally?

Posted on November 7, 2017
zzzz

By zzzz

I installed node, deployed my app (vue.js / nuxt app) and used npm install. When I use npm start it uses nuxt start and I get the message OPEN http://localhost:3000, which seems to be correct because if I open a second terminal and use netstat -plnt I get

 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      13929/node
tcp6       0      0 :::22                   :::*                    LISTEN      -```

I also if I use ```curl http://localhost:3000``` in a second terminal the app seems to work. However, if I enter ```http://MY_IP:3000/``` or ```http://MY_IP/``` in my browers I get ```Unable to connect - Firefox can’t establish a connection to the server at MY_IP:3000.```

Sorry, I am still quite new to this -  what am I doing wrong here? Why can't I access my app externally? Thanks for any help!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I think I found the solution. I added the following to my package.json file:

"config": {
 "nuxt": {
   "host": "0.0.0.0",
   "port": "3333"
 }
}

Apparently, 127.0.0.1 as host was the problem.

A bit more info: https://nuxtjs.org/faq/host-port/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.