Created
October 7, 2022 12:07
-
-
Save s1monw1/9553db20c78486f408eac05721b597a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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