krop icon indicating copy to clipboard operation
krop copied to clipboard

Routes should be able to generate paths

Open noelwelsh opened this issue 2 years ago • 0 comments

Routes should be able to generate a path that will call that route, so that the path can be embedded into HTML. E.g. if I have a route

val viewUser = 
  Route(
    Request.get(Path.root / user / Param.int),
    Response.ok[String]
  )

I should be able call something like viewUser.path(1234) to produce "/user/1234".

In other words Routes should be bidirectional. This is a step towards allowing routes to be used on the front and backend (and then automatically generating clients from routes).

noelwelsh avatar Oct 11 '23 09:10 noelwelsh