Author | Message |
---|---|
venny
Posts: 61
|
Posted 15:36 Nov 14, 2016 |
When I put down: app.listen(2000); It works when I go to localhost:2000
But when I try to run app.listen(80). I get an error
|
msargent
Posts: 519
|
Posted 15:38 Nov 14, 2016 |
Try 8080. |
wveit
Posts: 18
|
Posted 16:55 Nov 14, 2016 |
Is it at all possible that you have another web server running? Such as apache tomcat or apache server... as part of your projects from another class or personal projects? Or maybe a different nodejs server that was running on that same port but wasn't shut down? My understanding is that you cannot have more than one server operating on the same port. Does that sound right Professor Sargent? Also you may be able to get better information about the problem if you catch the error with a try catch block and print it. Good luck! |
msargent
Posts: 519
|
Posted 16:58 Nov 14, 2016 |
That does. Are you working on your Java web programming class at the same time, and have your Tomcat server running? |
wveit
Posts: 18
|
Posted 17:26 Nov 14, 2016 |
I guess one way you could rule out the possibility of another server using that port would be to restart the machine. That should shutdown any running servers. Then if you still get the same error when running your project, we'll know it's a different problem. |
venny
Posts: 61
|
Posted 18:19 Nov 14, 2016 |
I definitely do not have a tomcat working. Not in that class. |