caesar-rocks / core

🏛 Caesar is a Go web framework, designed for productivity.
https://caesar.rocks
MIT License
119 stars 3 forks source link

Add named routes #5

Closed alexisbz closed 5 months ago

alexisbz commented 5 months ago

Context

As of today, Caesar has no such a thing as named routes.

Named routes could be useful, for example to add a util named MakeURL on the router struct for example.

For instance, with the following route :

func RegisterRoutes(
           // ...
) *caesar.Router {
         // ...
    router.
          Post("/auth/reset_password/{jwt}", forgotPwdController.Show).
          As("reset_password.show")

We could do something like :

router.MakeURL("reset_password.show", "<my_jwt>")

Acceptance criterias