mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-28 23:55:50 +00:00
Add robots txt & noindex
This commit is contained in:
@@ -84,11 +84,19 @@ if (!wss) {
|
||||
|
||||
wss = expressWs(app)
|
||||
|
||||
// app.use(function middlware (req, res, next) {
|
||||
// return next()
|
||||
// })
|
||||
app.use(function middlware (req, res, next) {
|
||||
res.setHeader('X-Robots-Tag', 'noindex')
|
||||
return next()
|
||||
})
|
||||
|
||||
app.use('/',
|
||||
app.use('/robots.txt', (req, res, next) => {
|
||||
res.setHeader('content-type', 'text/plain')
|
||||
return res.send(
|
||||
`User-agent: *\nDisallow: /\n`
|
||||
)
|
||||
})
|
||||
|
||||
app.use('/',
|
||||
(req, res, next) => {
|
||||
if (process.env?.TELEMETRY === 'YES' && !req.url.match(/health/)) {
|
||||
const telemetryData = {
|
||||
|
||||
Reference in New Issue
Block a user