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 Build a REST API With Express Completing and Testing the API Test Routes with Postman

David Lloyd
David Lloyd
2,800 Points

post man response to localhost:3000/questions: "message": "Cannot read property 'find' of undef

when I run node app.js in my terminal the process runs properly and it returns: express-api davelloyd$ node app.js Express server is listening on port 3000 db connection successful but the terminal removes the command prompt and I cant enter any new prompts. and when I run the localhost:3000/questions GET in postman I get { "error": { "message": "Cannot read property 'find' of undefined" } } in the body. Please help.

Elise Kain
Elise Kain
54,392 Points

David - Can you post the code you are working with? It sounds like the application is running correctly, but you are trying to use the find method on something that is undefined. Maybe the variable you are using isn't defined yet?

1 Answer

David Lloyd
David Lloyd
2,800 Points

Hi sorry, i had several typos in my code and fixed it and finished the course. thanks for responding...