Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Created October 7, 2022 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1monw1/9553db20c78486f408eac05721b597a2 to your computer and use it in GitHub Desktop.
Save s1monw1/9553db20c78486f408eac05721b597a2 to your computer and use it in GitHub Desktop.
val nameLens: BiDiLens<Request, String> =
Query.nonEmptyString().required("name")
val greetHandler: HttpHandler = { req: Request ->
val name: String = nameLens.extract(req) //or nameLens(req)
Response(OK).body("hello $name")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment