London| 26 March SDC | Jamal Laqdiem| Sprint 3 | Middleware exercises#94
London| 26 March SDC | Jamal Laqdiem| Sprint 3 | Middleware exercises#94jamallaqdiem wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
LonMcGregor
left a comment
There was a problem hiding this comment.
Be careful when using something like typescript. You have both js and ts versions here. Which is the one that you intended to commit / be reviewed?
Good start, but I have some questions
| const count = subjects.length; | ||
| const subjectList = subjects.join(", "); | ||
| // 1. Format the authentication message using the custom header middleware | ||
| let authMessage = req.username |
There was a problem hiding this comment.
Why is this ternary expression required here for the auth message?
| const count = subjects.length; | ||
| const subjectList = subjects.join(", "); | ||
| // 1. Format the authentication message using the custom header middleware | ||
| let authMessage = req.username |
There was a problem hiding this comment.
Same question as before - what is the purpose of this ternary check?
There was a problem hiding this comment.
I used the ternary check, as defined in my express.d.ts the req.username can be typed as string or null, this check ensure that the app fallback the friendly message.
|
Thanks for reviewing, you are right to mention that, as it's my first time dealing with typscript, I should add the compiled folder dist into the .gitignore and push only the .ts files. |
LonMcGregor
left a comment
There was a problem hiding this comment.
This looks good now. Much cleaner with just the typescript. If you're using a compiled or translated language remember to commit only the original source.
Task is complete now
Changelist
Implement a custom middleware and a off the shelf middleware.