Created
October 8, 2020 10:24
-
-
Save BCsabaEngine/6f31b4d1ddcefca0df16849bed778ca7 to your computer and use it in GitHub Desktop.
ExpressJS remove routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.remove = (handler, router) => { | |
router = router || app._router; | |
for (let i = 0; i < router.stack.length; i++) | |
if (router.stack[i].handle == handler) { | |
router.stack.splice(i, 1); | |
break; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment