Rafael Diaz
10/19/2025, 2:57 AMRafael Diaz
10/19/2025, 2:57 AMval routes = listOf(
"/merchants" / merchantIdLens / "items" bindContract Method.GET to
{ id, _ ->
{ _: Request ->
Response(OK)
}
}
)
Say that we instead defined the routes in the shared module instead of in the server's. I admit I haven't tested it, but even if it did work, it would still complicate the developer experience since we'd have to go to another file to check what the route we're extracting is.Rafael Diaz
10/19/2025, 3:04 AMval merchant = "/merchants" . However, that makes telling what is a static or dynamic segment difficult.
To make it somewhat differentiable, I did consider just wrapping the variable names with backticks, such as `val `merchants``.
However, the Intellj does not seem to like this workaround. It warns that the backticks are redundant and are simply ignored by the compiler. And I'm rather iffy of a trick that causes IDE warnings. Furthermore, it means losing the IDE color coding where static segments (strings) and dynamic segments (variables) are colored differently.Rafael Diaz
10/19/2025, 3:16 AMRafael Diaz
10/19/2025, 3:20 AMs4nchez
10/21/2025, 9:41 AM