-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove routes #48
Comments
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. |
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.
The text was updated successfully, but these errors were encountered: