Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?