Skip to content

Instantly share code, notes, and snippets.

@BCsabaEngine
Created October 8, 2020 10:24
Show Gist options
  • Save BCsabaEngine/6f31b4d1ddcefca0df16849bed778ca7 to your computer and use it in GitHub Desktop.
Save BCsabaEngine/6f31b4d1ddcefca0df16849bed778ca7 to your computer and use it in GitHub Desktop.
ExpressJS remove routing
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