Closed jcorkhill closed 5 years ago
I'm wondering where the best place to require the module is if my routes and controllers are in separate files.
require
Should I require it in the same file where I create the Express Application?
Thank you.
Hi @JamieCorkhill, since we're patching Express#Router it's best to require it before the first use of it. It depends on your structure, but in most use-cases file where you create Espress app is good.
Express#Router
I'm wondering where the best place to
require
the module is if my routes and controllers are in separate files.Should I
require
it in the same file where I create the Express Application?Thank you.