-
Notifications
You must be signed in to change notification settings - Fork 1
Change image. add debug #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| const { getEnv } = require('../../../utils/env'); | ||
| const morgan = require('morgan'); | ||
|
|
||
| module.exports = { | ||
| options: { | ||
|
|
@@ -7,4 +8,13 @@ module.exports = { | |
| secret: getEnv('SESSION_SECRET'), | ||
| }, | ||
| }, | ||
| middleware(_self) { | ||
| return { | ||
| logRequests: { | ||
| middleware: morgan( | ||
| ':date[iso] :method :url :status :response-time ms - :remote-addr - :user-agent', | ||
| ), | ||
| }, | ||
| }; | ||
| }, | ||
|
Comment on lines
+11
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider making request logging environment-aware. The morgan middleware is unconditionally enabled for all environments. In production, verbose request logging can:
Consider gating logging or adjusting the format based on environment: ♻️ Suggested approach+const { getEnv } = require('../../../utils/env');
+
module.exports = {
options: {
session: {
secret: getEnv('SESSION_SECRET'),
},
},
middleware(_self) {
+ const nodeEnv = getEnv('NODE_ENV') || 'development';
+ const format = nodeEnv === 'production'
+ ? 'combined'
+ : ':date[iso] :method :url :status :response-time ms - :remote-addr - :user-agent';
return {
logRequests: {
- middleware: morgan(
- ':date[iso] :method :url :status :response-time ms - :remote-addr - :user-agent',
- ),
+ middleware: morgan(format),
},
};
},
};🤖 Prompt for AI Agents |
||
| }; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment.
wfrom→from📝 Committable suggestion
🤖 Prompt for AI Agents