Question

Create a real public web server with node js

Posted February 26, 2021 765 views
Node.jsDevelopmentJavaScriptProgramming ProjectInitial Server Setup

hi everyone, I was following this tutorial (https://www.digitalocean.com/community/tutorials/how-to-create-a-web-server-in-node-js-with-the-http-module ) because I would like to create a real web server, that is currently running on a raspberry pi.
actually now there is apache2 that is running on and it’s perfectly fine, but I want to try node.js because seams faster with a lot more easy function.

is a good idea for you? if yes do you know if is necessary to keep saying the port or if I can’t?

I am a beginner so have mercy of me if I am stupid

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.

×
Submit an Answer
1 answer

Hi there,

In case that you decided to go for Node.js I would recommend following this tutorial here on how to set up a Node.js application for production:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04

It uses Nginx as a reverse proxy so that you don’t have to type the Node.js port each time in your browser, and also you could use Let’s Encrypt to secure the installation.

Hope that this helps.
Regards,
Bobby

by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.