Skip to content

Instantly share code, notes, and snippets.

@sheeley
Created October 7, 2016 23:12
Show Gist options
  • Save sheeley/091be310d327097de26f99fe614d9b66 to your computer and use it in GitHub Desktop.
Save sheeley/091be310d327097de26f99fe614d9b66 to your computer and use it in GitHub Desktop.
restify list routes by path
const output = {}
for (const verb of Object.keys(server.router.routes)) {
console.log(verb)
for (const route of server.router.routes[verb]) {
const {method, spec: {path}} = route
if (!output[path]) {
output[path] = []
}
output[path].push(method)
}
}
console.log(output)
process.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment