Merge pull request #1747 from RafaelTaranto/backport/fail-fast-on-default-route
LAM-254 backport: fail fast on default route
This commit is contained in:
commit
f7216d088d
2 changed files with 11 additions and 0 deletions
|
|
@ -61,6 +61,15 @@ morgan.token('bytesRead', (_req, res) => res.bytesRead)
|
||||||
morgan.token('bytesWritten', (_req, res) => res.bytesWritten)
|
morgan.token('bytesWritten', (_req, res) => res.bytesWritten)
|
||||||
app.use(morgan(':method :url :status :response-time ms -- :bytesRead/:bytesWritten B', { stream: logger.stream }))
|
app.use(morgan(':method :url :status :response-time ms -- :bytesRead/:bytesWritten B', { stream: logger.stream }))
|
||||||
|
|
||||||
|
app.use('/robots.txt', (req, res) => {
|
||||||
|
res.type('text/plain')
|
||||||
|
res.send("User-agent: *\nDisallow: /")
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.sendStatus(404)
|
||||||
|
})
|
||||||
|
|
||||||
// app /pair and /ca routes
|
// app /pair and /ca routes
|
||||||
app.use('/', pairingRoutes)
|
app.use('/', pairingRoutes)
|
||||||
|
|
||||||
|
|
|
||||||
2
new-lamassu-admin/public/robots.txt
Normal file
2
new-lamassu-admin/public/robots.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
||||||
Loading…
Add table
Add a link
Reference in a new issue