Skip to content
New issue

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

Routes should be able to generate paths #1

Open
noelwelsh opened this issue Oct 11, 2023 · 0 comments
Open

Routes should be able to generate paths #1

noelwelsh opened this issue Oct 11, 2023 · 0 comments

Comments

@noelwelsh
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant