We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for example: r2 := r.Group('/openapi',middle func) r3 := r.Group('/authapi',middle func) r3.Get('/adduser',func handle) ....
The text was updated successfully, but these errors were encountered:
@runthinker
func main() { router := gin.Default() v1 := router.Group("/openapi") { v1.GET("/authapi", middle func) v1.GET("/adduser", middle func) } }
Sorry, something went wrong.
@shinriyo thank you! i use this method: func ValidToken(next httprouter.Handle) httprouter.Handle{ return func(....) .... } r.Get("/openapi/adduser",handle func) r.Get("/authapi/adduser",ValidToken(handle func))
You can check the pull request #89 , It has a good implementation of sub routing.
Or, check my Gist, which was inspired by the former one and gin.
No branches or pull requests
for example:
r2 := r.Group('/openapi',middle func)
r3 := r.Group('/authapi',middle func)
r3.Get('/adduser',func handle)
....
The text was updated successfully, but these errors were encountered: