I’m new to Glitch, but not so new with Node.js and programming in general. But breifly, I was messing around with the sample app created by Glitch and noticed something I found weird.
The app is simply an express app that creates a web server to show a webpage. However, the part that got my attention is that the port being used (as logged by the Glitch logger) is port 3000 (Express method:
My question is:
I’ve used Express locally in my computer and created lots of development servers and, as many of you surely know, you connect to that server via
localhost:3000 or whatever is your chosen port. My surprise was that I could connect to my Glich app via the provided host without specifying a port, what means it is using the default HTTP or HTTPS port, 80 or 443, and, that I could not connect to the host with the port 3000
I noticed I cound not either specify any other port to use.
Is that just a portfowarding used by Glitch?
If I wanted to created a server on another port for any reasion, how would I do it?
Thank you very much for the help!
I know it’s a very specific question but it really bothers me to do not fully understand what is happening in the background.