I'm new to the whole Node JS community and I'm trying to build a test app using MERN (Mongo DB, Express, React, Node JS). I'm coming from the LAMP stack (Linux, Apache, MySQL, and PHP).
I've set up my node.js server on Ubuntu 18 (AWS EC2) and I've installed Node JS, Express, and Mongo DB. From my understanding Express is a web server kind of like Apache or Nginx? So can't it replace Nginx and Apache? I see some tutorials that use Nginx with Express, I'm not sure why.
Also, how do I connect my domain (example.com) to my Node JS server? All the examples I see are with localhost on port 3000 or 3001. When I worked with Apache, all I had to do was point the domain to the IP address, then go into the 000-default.conf file (apache config file) and add the domain and directory for the domain to go to. But now when I point the domain to my Node server, it just says "refused to connect". Am I doing this correctly? I have my website application files in the folder "/var/app".
Example of the config from Apache:
<VirtualHost *:80>
DocumentRoot /var/www/html
# ...
</VirtualHost>
Thanks for the help all!