feat: add robots.txt to lamassu-server and lamassu-admin

fix: fail fast on lamassu-server default route access
This commit is contained in:
Sérgio Salgado 2022-09-16 05:26:30 +01:00 committed by Rafael
parent a29f3fc13c
commit 37e235452b
2 changed files with 11 additions and 0 deletions

View file

@ -56,6 +56,15 @@ app.use(nocache())
app.use(express.json({ limit: '2mb' }))
app.use(morgan(':method :url :status :response-time ms -- :req[content-length]/:res[content-length] b', { stream: logger.stream }))
app.use('/robots.txt', (req, res) => {
res.type('text/plain')
res.send("User-agent: *\nDisallow: /")
})
app.get('/', (req, res) => {
res.status(404).json({ error: 'No such route' })
})
// app /pair and /ca routes
app.use('/', pairingRoutes)

View file

@ -0,0 +1,2 @@
User-agent: *
Disallow: /