gin
gin copied to clipboard
How to get engine from *gin.Context?
Hi,
Is there a way to get engine from the Context? I have some middleware where I want to call HandleContext to do a redirect.
-Tomas
Hi, I guess you can only store a reference to it in the Context if you want to access it from there. As an alternative, you can use a global variable.
Can I get some background on this? I don't think this is a good solution. maybe a xy problem?