By MLR
Hello, I followed DigitalOcean’s (DO) instructions to deploy a simple “Hello World” app. Please keep in mind:
http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World on port 3001');
}).listen(3001, '999.999.99.999');```
Note: I've spent over 25 hours on this one aspect.
I've exhausted all resources I can think of. YouTube, DO, Google, ...
Thank-you, Michael Rooney
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!
@MLR Starting a new thread, since it got too narrow.
Find a small app and use that as your template. You need to have routes, and usually a folder called public where you place those things.
But again, this goes into waaayyy too much coding, so I would probably recommend that you ask in a Node forum like StackOverflow:
https://stackoverflow.com/questions/tagged/node.js
localhost is an alias of the IP 127.0.0.1. The 999-IP, well I’m guessing that’s your masked public IP, is still “owned” by the server, but that means Node is publicly available on port 3001 (if the firewall is open).
Using 127.0.0.1 means that it’s only services on the server that can see those - and that’s what we want, because we want Nginx to see Node and serve the data to visitors.
This comment has been deleted
I finally figured out an answer (myself). I poster it here. MLR https://www.digitalocean.com/community/questions/deploying-more-than-text-content-using-your-digitalocean-droplet
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.