Skip to content

Commit

Permalink
add optional chaining to route path
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Zettl committed Feb 15, 2021
1 parent 427ad7b commit d7f9ca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const loggerMiddleware = morgan('combined');
function useRouter(app: express.Express, prefix: string, router: express.Router) {
const path = `/${version}${prefix}`;

console.log(router.stack.map((r) => `${Object.keys(r?.route?.methods)?.[0].toUpperCase()} ${path}${r.route.path}`));
console.log(router.stack.map((r) => `${Object.keys(r?.route?.methods)?.[0].toUpperCase()} ${path}${r?.route?.path}`));
app.use(path, router);
}

Expand Down

0 comments on commit d7f9ca8

Please sign in to comment.