Route Options

Router allows specifying options for a route.

router.Get("/", index, 
    opt1, 
    opt2,
    // ...
)

Route Name

RouteName is used to generate URLs, checkout URL Generation for details.

Route Middleware

RouteMiddleware is an option that allows plugging middleware into particular route.

router.Post(
    "/posts",
    createPost,
    clevergo.RouteMiddleware(
        rateLimiter,
        bodyLimiter,
        // ...
    ),
)
comments powered by Disqus