You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My concern about this code is, if I can do it without affecting the actual chi instance used inside this backend/server.
Note that I'm instantiating a new router, I intercept and recover from a panic in the case of the pathPattern is invalid.
Doing some tests I noticed an random behavior on the actual chi instance, some routes has starting to respond 404, but I wasn't able to reproduce again.
There is another way to use the route match logic without instantiate another chi router?
The text was updated successfully, but these errors were encountered:
I hope I understand your question well, I think you can use the singleton pattern for this purpose.
Or you could have a mother struct that hold the router (idk if it is applicable to your case):
typeServerstruct {
router chi.Router
}
About
Doing some tests I noticed an random behavior on the actual chi instance, some routes has starting to respond 404, but I wasn't able to reproduce again.
I never noticed this problem while using go-chi unfortunately so I can't help :/
I'm creating a proxy server, and I has this route:
/proxy/*
When the requests occours, I get this URL param
*
, and I check this param if it matches with my internal records on a database.For that, I was using a chi Router like this:
My concern about this code is, if I can do it without affecting the actual chi instance used inside this backend/server.
pathPattern
is invalid.There is another way to use the route match logic without instantiate another chi router?
The text was updated successfully, but these errors were encountered: