Unroute
Unroute unregisters endpoints in Express Routers, identifying them via their path and method signature.
Usage
Install via npm:
npm install unroute --save
//If your route is set up for a delete endpoint on /api/test1:var express = ;var app = ;var router = expressRouter;router ; ... //...you can use Unroute to remove that route specifically:var unroute = ;unroute; //or leave out the methods param to remove entire route:unroute;
remove(router, path, methods)
- @param {Express.Router} router
- @param {string} path
- @param {array} methods - e.g., ['GET', 'PUT']. Defaults to all methods if null.
Tests
Tests are written in mocha/chai.expect.