mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00

* feat: disallow search indexing * Update index.js * Update .env.example * added middleware
11 lines
240 B
JavaScript
11 lines
240 B
JavaScript
const noIndex = (req, res, next) => {
|
|
const shouldNoIndex = process.env.NO_INDEX ? process.env.NO_INDEX === 'true' : true;
|
|
|
|
if (shouldNoIndex) {
|
|
res.setHeader('X-Robots-Tag', 'noindex');
|
|
}
|
|
|
|
next();
|
|
};
|
|
|
|
module.exports = noIndex;
|