GET / 404 Not Found on ngrok - node.js

I wanted to expose a NodeJS app running on port 3000 using ngrok. I don't find any logged error messages, that could guide me. I am new to ngrok, and am not sure, what's the mistake. Does the location where it its installed matter. I think, ngrok hasn't been added to PATH variable on windows.
Please help on this.

Related

Vue application running on Digitalocean times out in browser

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!

PeerJS Server 404 on Azure

I'm trying to deploy a PeerJS server on Azure. On my kudu console, running
node peerjs --port 9000
returns
Started PeerServer on ::, port: 9000, path: / (v. 0.2.8)
However, when I try to connect to the server from my client code, I get a 404. Going directly to appname.azurewebsites.net/peerjs/id in my browser also returns a 404.
I see inside their package.json file, they run
bin/peerjs --port ${PORT:=9000}
instead of just passing in 9000 directly; I assume this is an environment variable. However, trying to run this on Azure gives
Error: Error: listen EACCES ${PORT:=9000}
which I assume means Azure doesn't recognize ${PORT:=9000} as a valid port.
I know for a fact there's nothing wrong with my client side code because a) I copied it directly from PeerJS's website, and b) everything works correctly when I deployed PeerJS to Heroku. It's only not running on Azure.
Other things I've tried: I edited peerjs in the bin folder to use process.env.PORT instead of what's passed in via the command line, but that didn't work, giving the same EACCES error. When I tried to console.log(process.env.PORT), I got undefined. None of my Google searches have turned up any solutions, although this person (Custom PeerJs Server giving ERR_CONNECTION_TIMED_OUT) seems to have a similar error, not on Azure.
Azure App Service doesn't allow us to listen on a customer port. We need to use process.env.PORT instead. See Listen additional port Microsoft Azure Nodejs.
Azure App Service (on Windows platform) runs on Microsoft IIS. So we need to put the app files to its virtual directory (D:\home\site\wwwroot) and no longer need to manually run the app via the Kudu console.
In this case, you first need to install the library under app's root:
npm install peer
And then create a file named index.js or app.js with following content and put it to /wwwroot folder:
var PeerServer = require('peer').PeerServer;
var server = PeerServer({port: process.env.PORT, path: '/'});
As #Mikkel mentioned in a comment, PeerServer uses WebSocket protocol, so Web Sockets should be enabled in the Azure portal like this:
You also need to check out this post to add a web.config file for your app if it has not been created yet.
This will be a firewall problem... You will need to open port 9000 in your Azure settings panel.
From the machine itself, open up a browser to http://localhost:9000/ or http://localhost:9000/peerjs and you should see the standard Peerjs server JSON output.
Or if you only have command line, try curl http://localhost:9000/ or http://localhost:9000/peerjs

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 –

ECONNRESET proxy error between dev server and API

When I run my development server, I get the following error.
Proxy error: Could not proxy request /graphql from localhost:3000 to http://localhost:3010.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
It is preventing me from proxying any requests from the development server to the API.
After debugging, I realized it was not a problem with the code because my colleague and I are working from the same repo and he does not have this error. Also, sometimes if I restart my terminal the error will go away before it comes back again.
Would greatly appreciate guidance on what is the root of this issue and how I can resolve it.
What I discovered, and what seems to have solved the problem, is that I was running too many different servers on ports that were too close together. My servers were running on port 3000, 3010, and 3009. I noticed that whenever the server at 3009 was running, I would get the above error. When I changed the port for that server from 3009 to 9999, all proxy errors ceased.

Website on Ajenti V with Node.JS content always throw 404

I install AjentiV to manage my website. Now I have an webapp on NodeJS and want to use with AjentiV. I follow a simple tutorial Setting up a Node.js website with Ajenti V (Keystone example) .
I config the Content of website to Node.JS, provide the script and config port 8080. I use port 8080 for the Node app, there are no error but I try the webapp always throw 404 - Not found result, in both port 80 and 8080.
Has anyone met this problem before? How can I make it works?
Thank you in advance! :)
Sorry, my bad. There is no problem with AjentiV and Node.JS content. The problem itself is the our webapp always throw 404 due to my fault config.

Resources