i setup a nodejs droplet. installed pm2 and copied the files to a folder with filezilla. also created a firewall to allow traffic on port 6000 and linked it to the droplet. ran the app with pm2 start app.js
note: this is my first time using digitalocean note: tried doing calls to my ipv4 address aswell as the floating one
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!
By default node.js will listen only on localhost/127.0.0.1 for local requests. If you specify the IP address in your app as 0.0.0.0 it will listen on all IPs. Another option is to enter only the IP it will be used with (if using a floating IP this is the anchor IP, not the public floating IP users will use).
This shows an example that should listen publicly on port 6000 as long as there is not a firewall blocking it.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(6000, "0.0.0.0");
console.log('Server running at http://0.0.0.0:6000/');
digital ocean blocking by default port above :6000 , dont know the reason but , if you will run node less then 6000 then only its working fine for web and APK else only working on APK…
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.