I have a JSON config file which specifies API end-points. I read it on app load and iterate through its keys, like this
server[type](config.path, function (req, res, next) {
});
Now, I am looking for a way to remove that route from server. I mean delete the API I just created. Is there any way by which it can be done? I checked the docs but couldn't find anything related to this.
I tried removing keys in server.routes
. But it creates new keys with different name and I am not sure why it creates. for example if I delete a route getusers
from server.routes
, a new key is created like server.routes.getusers234234
(some random number appended).