httptreemux
httptreemux copied to clipboard
Remove routes
Since we can now add routes at runtime (using the mutex), I think it would be appropriate to provide a function to remove routes as well.
Please excuse me if there is such a function already. I couldn't find anything.
Yeah, this should be pretty easy to do. I can add it some time this month.
Great :) A function to remove all routes would be good as well.
Sorry, I see this issue, but I still don't see the solution. Is it possible to add this feature?
It turned out to be a bit tricky, and nobody seemed to care that much so I never implemented it. If someone wants to submit a PR I'm glad to look it over. The tricky part is that adding a route can sometimes add a few different entires into the tree, such as implicit HEAD handlers for a GET operation, so the remove operation needs to get rid of them all.
I just remembered there's a branch where I started some of this work: https://github.com/dimfeld/httptreemux/tree/delete_routes
The commit says "mostly complete" and it's been so long that I can't remember what, if anything, is missing from it. It's definitely missing tests.