ozzo-routing icon indicating copy to clipboard operation
ozzo-routing copied to clipboard

Is there a way to get the name of current route?

Open puper opened this issue 7 years ago • 2 comments

Im want to do some permission check in middleware.

puper avatar Sep 05 '17 15:09 puper

I don't use this package, but by looking at the source code, I can say you can get the request path using this:

func yourController(c *routing.Context) {
     path := c.Request.URL.Path
     c.Write(fmt.Sprintf("you hit %s", path))
}

abdrd avatar Dec 30 '21 10:12 abdrd