Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics Getting Started with Express Creating a Server in Express

Britton Kitchell
.a{fill-rule:evenodd;}techdegree seal-36
Britton Kitchell
Full Stack JavaScript Techdegree Graduate 14,927 Points

Port Number?

How did the instructor know the port number was 3000? I am not entirely clear how those work, but I was under the impression they were randomly generated server side (or something like that). Can anyone clarify?

1 Answer

Rohald van Merode
Rohald van Merode
Treehouse Staff

Hi Britton,

In the video Andrew specified the port number in the code on line 5 around the 2:25 minute mark. The listen method will bind and listen for connections on that specified port number when running your code locally. If he would have entered 5000 there the app would have been available on localhost:5000.

Hope this clears things up 🙂