azu / express-lazy-router

Lazy loading for express router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Give middleware function a name

daniellockyer opened this issue Β· comments

Hey @azu! πŸ™‚

Would it be possible to give the middleware function a name? Tools such as New Relic report it as <anonymous> otherwise, which makes it difficult in tracking down the source.

lazyRouter.use((req, res, next) => {

commented

Yes, it is possible and reasonable.

-        lazyRouter.use((req, res, next) => {
+        lazyRouter.use(function lazyRouterHandler(req, res, next) {

PR sent πŸ™‚