Skip to content
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

Open
kabukky opened this issue Mar 21, 2017 · 5 comments
Open

Remove routes #48

kabukky opened this issue Mar 21, 2017 · 5 comments

Comments

@kabukky
Copy link

kabukky commented Mar 21, 2017

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.

@dimfeld
Copy link
Owner

dimfeld commented Mar 21, 2017

Yeah, this should be pretty easy to do. I can add it some time this month.

@kabukky
Copy link
Author

kabukky commented Mar 22, 2017

Great :) A function to remove all routes would be good as well.

@yifanes
Copy link

yifanes commented Jan 3, 2020

Sorry, I see this issue, but I still don't see the solution. Is it possible to add this feature?

@dimfeld
Copy link
Owner

dimfeld commented Jan 3, 2020

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.

@dimfeld
Copy link
Owner

dimfeld commented Jan 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants