list all routes in HTML to make them clickable

xr
Fabien Benetou 1 year ago
parent 6cb7a8c8c8
commit ff1454d061
  1. 7
      index.js

@ -116,6 +116,13 @@ app.use(function(req, res, next) {
app.get('/', (req, res) => {
res.send( instructions )
// see issue 20
})
app.get('/routes', (req, res) => {
let routes = app._router.stack.map( r => r.route?.path ).filter( r => typeof(r) == 'string' )
let formattedRoutes = routes.map( r => `<li><a href='${r}'>${r}</a></li>` ).join('\n')
res.send( formattedRoutes )
})
app.get('/authtestviaheader', (req, res) => {

Loading…
Cancel
Save