There have been some middleware changes on the new version of express and I have made some changes in my code around some of the other posts on this issue but I can\'t get a
I had this error and solution help which was posted by Anirudh. I built a template for express routing and forgot about this nuance - glad it was an easy fix.
I wanted to give a little clarification to his answer on where to put this code by explaining my file structure.
My typical file structure is as follows:
/lib
/routes
---index.js (controls the main navigation)
/page-one
/page-two
---index.js
(each file [in my case the index.js within page-two, although page-one would have an index.js too]- for each page - that uses app.METHOD or router.METHOD needs to have module.exports = router; at the end)
If someone wants I will post a link to github template that implements express routing using best practices. let me know
Thanks Anirudh!!! for the great answer.