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! While you're at it, check out some resources Treehouse students have shared here.

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

ReferenceError: homeRoute is not defined

Trying to setup the home route in the Build a Simple Dynamic Site with Node.js and receiving the following error in gitbash:

$ node app.js
Server running at http://<workspace-url>/
C:\Users\home\Desktop\Code_Louisville\Projects\Examples\Node.js\Dynamic\app.js:1
0
    homeRoute(request, response);
    ^

ReferenceError: homeRoute is not defined
    at Server.<anonymous> (C:\Users\home\Desktop\Code_Louisville\Projects\Exampl
es\Node.js\Dynamic\app.js:10:5)
    at emitTwo (events.js:87:13)
    at Server.emit (events.js:172:7)
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:533:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)

When I try to run the localhost in my browser, I get this response: This site can’t be reached

localhost refused to connect. Search Google for localhost 1337 ERR_CONNECTION_REFUSED

I am stuck and can't move forward. Please help!

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

Can you provide your code please?