Add robots txt & noindex

This commit is contained in:
Wietse Wind
2023-11-07 00:57:54 +01:00
parent 3e6df4a629
commit 092b0f57fb

View File

@@ -84,9 +84,17 @@ 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('/robots.txt', (req, res, next) => {
res.setHeader('content-type', 'text/plain')
return res.send(
`User-agent: *\nDisallow: /\n`
)
})
app.use('/',
(req, res, next) => {