Download api/server/middleware/noIndex.js from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 240 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/server/middleware/noIndex.js
- Command line
-
hf download hf://spaces/Zhitomir/chat/api/server/middleware/noIndex.js
-
curl -L -o noIndex.js https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/server/middleware/noIndex.js
240 Bytes
| 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; | |