twitter/scala_school

Finagle: show how to set up a server that has a filter

lahosken opened this issue · 1 comments

I have a service that should only be available to auth'd users. When I read Scala School's Finagle page, I'm pretty sure I want to put together my service, some ServiceBuilder code, and a filter, uhm, somehow. I can figure it out if I re-read carefully while thinking really hard. But thinking is for chumps. We probably either want to copy-from and/or link-to an example like

https://github.com/twitter/finagle/blob/master/README.md#Building%20a%20Robust%20Server

val service: Service[Req, Rep] = ...
val filter: Filter[...]
val filteredService = filter andThen service
ServerBuilder()
  ...
  .build(filteredService)