list all routes in HTML to make them clickable
This commit is contained in:
7
index.js
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) => {
|
||||
|
||||
Reference in New Issue
Block a user