Why does node.js backend server not respond port 3000 for downloaded sample code?

Not applicable

When writing the code from scratch (from ZeroToApp eLearning Exercise) I have had some minimal issues in getting things to work (typos and the like) but later, when the instructor (Greg) advises to download sample app and change organization name to match, I do this. Greg then types in the URL something like this: localhost:3000 and does a refresh. This causes the sample app to reload. When I do this however, the server does not respond. I am forced to open the file index.html from the directory and then get the obvious message "unable to determine your geoLocation" . All of my samples worked through the geoLocation exercise and after this, I have had problems with running the sample code as mentioned above. Any advice for such a basic (hopefully easy ) question?

0 2 6,706
2 REPLIES 2

Dear @Steven Longheinrich , Can you please give us link to the video / tutorial you are talking about ?

Not applicable

Hi, here is the link:

http://academy.apigee.com/courses/elearning/zero-app/zero-app/creating-connections/handling-multiple...

At the very beginning the instructor, Greg mentions that you can download from j.mp/apigee-v3-delete to catch up. Keep in mind however, there is an existing node.js server that has been configured to listen on port 3000. I chose this video as an example but in fact all of the downloads in the "Creating Connections" section of the course aren't working.

In my earlier post I highlighted that Greg does a "localhost:3000" and the sample app pops up without any additional info needed.

Also, in the previous examples (previous sections of the course) when the server was initially set up it was listening on port 8888 and there was a static file (__dirname) which enabled the index.html file located in the sample directory to be automatically picked up. This configuration was working for me. But later the configuration was changed by adding a new server.js javascript file (with some 103 lines of code) that would listen as a proxy on port 3000 and then update the database. I can provide more details on this because now I am seeing "unable to update database" in the log files as well when I run with the latest version listening on port 3000.

One final point: When I type in "localhost:3000/hello", I at least get a diagnostic message back from the node.js server with "Hello from Express" which is configured in the server.js.file.