I want to get all the actions / route of a .js file with its method type. Basically I want to create a function that returns me all the actions and methods.
router.get('/this/is/action', function (req, res, next) {
}
router.post('/another/action1', function (req, res, next) {
}
So, in this type of case, my function will have to return the answer to me as if.
{
"data":[
{
"url":"/this/is/action",
"method":"get"
}
{
"url":"/another/action1",
"method":"post"
}
]
}
source
share