I have a NodeJS app running with express which I'm trying to access at the port 80.
So I have this:
app.listen('80', function () {
console.log('Server started');
});
Going to the browser I can acess it by typing "localhost", "127.0.0.1", both with or without :80 as a port.
My question is how can I access it from another computer?
Whenever I type the IP on the browser, it respond as "bad request, invalid hostname"
Your approach is correct. The Express application should be visible by other computers on the same network.
My best guess is that there is "something" running on your computer that prevents port 80 to expose. Or a conflict with another application that is using port 80 as well. (most unlikely because express cannot run if the port is already in use.).