Hi,
I need to handle all requests in one route.
For example, I have website with many urls, smth like /, /users, /users/list ... etc
I want to use only one route to handle all this, something like
r.Any("*", handle) and all my requests need to handle by this route.
How can I make it?
Thanks for help
I think you need to use middleware instead of routing
router.Any("/*proxyPath", handler)
Access path from handlers with:
func someHandler(c *gin.Context) {
c.Param("proxyPath")
}
Most helpful comment
Access path from handlers with: