Remove Globals
josephspurrier opened this issue · 2 comments
josephspurrier commented
Is there a reason why these must be called on the vestigo package instead of on the router? If someone wanted to use more than one router, they couldn't set this methods on the individual instances of the router. It also complicates testing because you can't guarantee state.
vestigo.AllowTrace = true
vestigo.CustomNotFoundHandlerFunc(fn)
vestigo.CustomMethodNotAllowedHandlerFunc(fn)
vestigo.Param(r, name)
husobee commented
Yes, I agree. It would be nice to be able to have multiple instances of routers, and allow for cleaner testing. Will see what I can put together, unless you have a fork with a proof of concept already implemented.
josephspurrier commented
Nah, I don't have a fork yet. Let me know if you need any help testing.