Skip to content

Commit

Permalink
Added name to middleware function (#8)
Browse files Browse the repository at this point in the history
fixes #7

- this allows code instrumentation tools (such as New Relic) to detect
  the function name instead of labelling it as `<anonymous>`
  • Loading branch information
daniellockyer committed Aug 30, 2023
1 parent e70a4ad commit d4eaef7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/express-lazy-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You need to return a promise object from the callback function.
}
});
};
lazyRouter.use((req, res, next) => {
lazyRouter.use(function lazyRouterHandler(req, res, next) {
if (loadedRouter) {
return loadedRouter(req, res, next);
} else {
Expand Down

0 comments on commit d4eaef7

Please sign in to comment.