MCPcopy Create free account
hub / github.com/github/docs / robots

Function robots

middleware/robots.js:6–17  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

4Disallow: /`
5
6export default function robots(req, res, next) {
7 if (req.path !== '/robots.txt') return next()
8
9 res.type('text/plain')
10
11 // only include robots.txt when it's our production domain and adding localhost for robots-txt.js test
12 if (req.hostname === 'docs.github.com' || req.hostname === '127.0.0.1') {
13 return res.send(defaultResponse)
14 }
15
16 return res.send(disallowAll)
17}

Callers

nothing calls this directly

Calls 1

nextFunction · 0.50

Tested by

no test coverage detected