Hoping you can help troubleshoot an Express Router issue located in record.js file. I have been working through How to Use MERN Stack: A Complete Guide. The first function (in record.js file) that gets a list of all records works fine. I can retrieve all records if I use the tutorial scripts (images below for reference). I can even hard code a query in the find() method to retrieve filtered results. However, I would prefer pass queries in from the front end rather than manually entering text.
- How can I pass a parameter from the frontend fetch() request (located in recordList.js file), and place it in the backend find() method?
- Also, is there anything I can do to console.log() within the backend router function? Nothing displays in the console when I try.