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

1st Node Server Deployment Help

Hello Team Treehouse,

I am a new member and have been going through javascript tutorials on Mean Applications.

I am attempting to launch my first simple web application on Heroku!

It will be a simple app that uses the youtube API to pull video through a query, store the video information in MongoDB, access this information using an express server API, and finally, display the information in the Ionic framework.

I have uploaded a smaller size of the application to Github with the core files.

https://github.com/HowieRatt/BP-TV-Node

I am stuck with an unknown error on line 58 of my youtube-service-provider.

I have been receiving the error ever since I've uploaded to Heroku. I received no error locally!

I'm seeing an error that is displaying my local address and does not seem to point to the hosted server on Heroku? is this a CORS issue or code? Any information you can provide would be most appreciated.

https://blackpackertv.herokuapp.com/

Thanks. Howie

1 Answer

Neil McPartlin
Neil McPartlin
14,662 Points

Hi Howie,

I don't have much experience in your proposed configuration but I have visited your Herokuapp site and I am seeing the same error message as you, including your own 'local' internal IP address (http://192.168.0.106:8080/videos/). I then looked at your git files and sure enough, I found the URL 'hardcoded' on line 212 of ...BP-TV-Node\git-test-files\www\build\main.js.

I cannot be sure this specific file is also located on the Herokuapp site but if not, a string search on all files on your site for any instances of your local IP address, may well hold the clue.

Looking at main.js, large portions of that file look like they have been compiled from a typescript file or maybe by Ionic, so although I would be inclined to start by directly editing that URL by replacing it with your actual site address, others reading this with more experience may identify a more elegant solution which means going forward, your configuration can work seamlessly on both your local PC and on the website, without the need to manually edit entries to recognise on which environment you are working/testing. Good luck.