Monday 22 July 2019

Is it an anti-pattern to instantiate a new instance of Router() within every routes file?

I've tried instancing and passing around a single instance, but that introduces complexity and complications (the mappings of `req, res` get butchered). Just wondering if instantiating a new instance of `Router` within every routes file (e.g., users, animals, whatevers) is a bad practice.

Submitted July 22, 2019 at 08:30PM by IanAbsentia

No comments:

Post a Comment