Skip to content

Commit

Permalink
feat: removeAllRoutes public method
Browse files Browse the repository at this point in the history
This method allows to clear routes stack. As discussed here: expressjs/express#4296
  • Loading branch information
robertsLando committed May 27, 2020
1 parent fb3c003 commit d3af9e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@ Router.prototype.process_params = function process_params(layer, called, req, re
param()
}

/**
* Remove all paths from the current stack
*
* @public
*/

Router.prototype.removeAllRoutes = function removeAllRoutes() {
this.stack = []
}

/**
* Use the given middleware function, with optional path, defaulting to "/".
*
Expand Down

0 comments on commit d3af9e9

Please sign in to comment.