Vue application running on Digitalocean times out in browser - node.js

First time I try to use a node.js droplet on Digitalocean: I have a vue.js application running on port 8080, but it times out when I try to load the masterpiece in the browser (I don't have a domain so I use the [server IP]:8080 to access it).
I made sure 8080 is open in the firewall (ufw):
Netstat -pln gave the result seen in the screenshot below, a node program is running but nothing is named vue in case that would be required:
Tried export HOST=0.0.0.0 on advice from a friend, but didn't seem to do anything.
Tested curl 127.0.0.1:8080 from the digitalocean console and it works correctly.
The browser error message is err _ connection timed out.
Any tips on how to get this to show in the browser? As I'm not experienced in working with servers please give me step by step instructions. Thanks!

Related

Node.js / curl(7) failed to connect to localhost port 3000. How to fix it?

response from testing
code hello.js
i am trying to create a web service with node.js. Unfortunately after implementing the application hello.js i am only able to test successfully "node hello.js", but furthermore when i type in "curl http://localhost:3000" i am getting "curl: (7) Failed to connect to localhost port 3000: connection estavlishment rejected"
This also happens with other ports oder when i type 127.0.0.1 directly. I also disabled my firewall with ufw and allow 3000 with ufw.
I am working with VirtualBox for a uni project. I am running everything in the VM. The goal is to cluster with docker and i need the web server for loadbalancing in the end.
Thanks!
The issue here that you use same terminal for multiple processes. As soon as you start the server, it holds the terminal. It means when you press Ctrl + C (^c in terminal output), you stop the server.
In your case you should use two terminals. In the first one you start the server (and do nothing with this particular terminal), in second one you make the request. Or you can change second step and make request from browser (it will be GET request by default), Postman, Insomnia etc.

Port not running but app wont stop running in browser - Windows - React - Node

So when I go to localhost:3001 it shows project I worked on before. I restart my computer, its still there, kill all node/vscode processes in task manager, its still there. I tried the npx kill port 3001 - seems ok says "port killed" but, the app still there in localhost 3001. When I use netstat findstr 3001 shows nothing there. When I use CurrPort or cmd to check all ports listening - 3001 doesn't show up.
If I listen in port 3000, everything works normal, but when I npm start another app in React itll take me to port 3001 and it doesnt give any error. Except when it opens on Port 3001 it doesnt display the app I npm started in, it still shows that ghost app that I cant get out of port 3001.
In the network tab of the ghost app/port 3001 it shows port 3001 there. I cant post screenshots cus low reputation but idk if something with the initiators in network tab might give a hint to what the problem is.
I could always just set it so React uses 3002 onwards or just run one app at a time in port:3000 buts its bothering that this ghost app has taken over a port.
Hopefully its just something stupid Im overlooking, but if anybody ever had a similar experience let me know!
TL:DR my port 3001 is showing not running listening everywhere I check but everytime I go to it it shows this old project and if I try to run another app at the port terminal says its running, everything ok ,but it is still that old app still there
So it seemed to be something with the browser not port, worked normal in another browser. So went into the inspector tools of the browser went in storage and deleted all cookies, cache, local&session storage and that fixed it. Also killing the service-worker.js process in the port worked for someone else who had the same problem from the project.

How to run a NODE.JS server on local wifi?

So I've tried making my server listen on IP - 0.0.0.0 and on port 8080, then when I open up the browser (Chrome) and type https://192.168.0.1:8080/, Chrome says 'This site can’t be reached'. Although when I run the server in the CMD it starts working totally fine, which I think should be a sign for the server actually running somewhere.
Everyone's help is very appreciated!

how to run nodejs app in vps with plesk enable

Hi guys im newbie in vps... I've bought an ovh not managed vps . I like to face problems... But I don't find any documents to these one. Is simple like I said I want to run a nodejs app in centos vps environment but I have enabled plesk.. and I saw in console running the app with the trace but I try to open website with the port and doesn't find anything.
http://vps406315.ovh.net
Thx for all guys
-----------------EDIT-------------------
I'm going to explain better,sorry for previous post.
There is no error, in my console all is ok. Like I said i have an CentOS VPS. Steps that I did:
Connect with PUTTY
Go to folder where is the NodeJS project.
I set the port to 8080
Write node index.js
The app is running and writing the right trace.
I use chrome to check the ip, and show me the default plesk page.
I use wget to check it, and with only http://92.222.71.137/. I attach
an screenshot
I tried to use with the port 8080 with the chrome and wget in putty,
and the response was the same.
In the other hand if I use http://92.222.71.137:8080/login with putty
download the right login.html, and the nodejs app write a trace
indicate me that someone connect to that page. But if I access with
chrome is not working.
Now I would like no know how to make access frome Chrome.
Thx 4 all and sorry for my newbie knowledge
You should give some other details on the configuration or eventual errors you get (both on the browser and the VPS) and how you run the node app (behind a web server, for example)
If you are not running you node app behind a web server, are the node app listening on the correct interface ? 127.0.0.1 and 92.222.71.137 (your site external address) are not the same.
On your VPS you can try to call the node app from the VPS itself using wget or cURL and looking for what happen in the app trace.
Finally it was easy... only i had to open a port to use with TCP, using
iptables -I INPUT -p tcp --dport 8856 --syn -j ACCEPT –

localhost:3000 connection refused after app.js is set (Windows 7)

I've followed this manual of installing MEAN stack https://thecodebarbarian.wordpress.com/2013/07/22/introduction-to-the-mean-stack-part-one-setting-up-your-tools/
and I got stuck on the point where I should be able reach for localhost:3000 successfully, but instead I get ERR_CONNECTION_REFUSED. I checked the ports using
netstat -an
and it seems my port 3000 is not even open. My Apache is working on port 80 and after reaching for localhost:80 everything works fine (I even checked if closing the Apache helps). The only thing I changed in the manual is that I installed both express and express-generator thanks to this install express with npm.
Can anybody tell me what should I do additionally so my port 3000 responds?
EDIT: I also checked the host files in system32, the only localhost address I have is 127.0.0.1 (three times, though!)
EDIT2: Solved, same issue as here: Express Node.js doesn't work
Remember to change the app.js file in the folder you are currently working in!

Resources