Having searched through similar posts, I am unsure and lack the experience to apply the suggested resolutions to my project. I recently built a basic app with two main routes as part of a Udemy course, but I am struggling with the following error: "Route.get() requires a callback function but got a [object String]". While I understand the concept of exporting a router object with nested routes for a root route, the request for a callback in this context is confusing. The error originates from the route.js file within the node_modules library at node_modules\express\lib\router\route.js:211:15.
I attempted to create a new test controller, only to encounter the same issue even without importing any route files. When I deleted the route.js file from the library, a new error emerged stating: "Cannot find module './route'." It seems that I have hit a dead end.
I would greatly appreciate any insights and suggestions to resolve this issue. Below, I have included the route, controller, and package.json files for reference:
Controller (app.js)
// Code snippet provided
//================================================================================================== Route file (campRoutes.js)
// Code snippet provided
//==================================================================================================
package.json file
{
"name": "yelpcamp",
"version": "1.0.0",
// Other package details
}