-
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
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
Update index.js #5761
Update index.js #5761
Conversation
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.
Thanks for your contribution @ritanshu747! Currently Express@4.x is supporting Node@0.10 so the ES6 syntax is not allowed (const, let, arrow functions, template strings...).
var app = module.exports = express(); | ||
|
||
// config | ||
const express = require('express'); |
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.
const express = require('express'); | |
var express = require('../..'); |
The examples are running as part of the Express tests suite, so express is imported locally and not as an external module
resave: false, // don't save session if unmodified | ||
saveUninitialized: false, // don't create session until something stored |
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.
Please don't remove the comments
res.redirect('/login'); | ||
} | ||
}); | ||
}); | ||
|
||
/* istanbul ignore next */ |
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.
Please don't remove this comment as it will have a negative impact in our tests coverage reports
res.redirect('/login'); | ||
} | ||
}); | ||
}); | ||
|
||
/* istanbul ignore next */ | ||
if (!module.parent) { |
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.
Please don't remove this condition as is designed to help us to run the examples as part of the testing suite or independently.
The current codebase follows JavaScript Standards, so thats worth looking into I guess. |
By implementing these improvements, Express.js application will be more secure, maintainable, and aligned with best practices. Always stay updated with the latest security advisories and Express.js releases to ensure your application remains secure and efficient.