All server processes must listen on a port.
When you see a URL like http://www.example.com, there is an implied port. If the protocol is http
and there is no port in the URL, then the browser will automatically use port 80. So, if that URL reaches a server, it's because the server at example.com is listening on port 80. The default port for https
is 443.
Could I for example make the application not need a port and it goes off of the domain instead of a port like example.com
No. Your application server needs to listen on a port. As I said above, you can leave the port out of the URL if the port is the "default" for that protocol and whoever is processing the URL will automatically use the correct port. But, your server still must be listening on the proper port.
Like I want to add a app.route() would I be able to do that just in public_html?
I don't know what this means. You would not add routes in your HTML file. Adding routes would be done in a JS file on your server.
I run an Apache server on a shared host that uses cPanel.
You typically cannot run a node.js server that directly serves incoming connections from that type of hosting. You need hosting that supports long running server processes with routing of incoming connections to them. Your provider may offer that (at a different level of service) or you may need a different provider.
There are ways to use Apache as a proxy to route incoming connections to your node.js server, but that is typically not something you can configure yourself in a shared hosting environment. That would usually require a higher level of hosting service.
It is also possible use node.js as a batch execution environment from Apache (somewhat analogous to how PHP is run by Apache), but that is not running a node.js server. That's just running a node.js script from scratch each time a specific route is hit in Apache (so that's probably not what you want or were asking about).
You may find this a useful read: Running Node.js in apache?.