Skip to content

Instantly share code, notes, and snippets.

@bryce-anderson
Last active December 30, 2015 05:09
Show Gist options
  • Save bryce-anderson/7780474 to your computer and use it in GitHub Desktop.
Save bryce-anderson/7780474 to your computer and use it in GitHub Desktop.
Working challenge
case req@ Post -> Root / "challenge" =>
val body = req.body.collect {
case c: BodyChunk => new String(c.toArray)
}.toTask
body.flatMap{ s: String =>
if (!s.startsWith("go")) {
Ok("Booo!!!")
} else {
Ok(emit(s) ++ repeatEval(body))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment