Skip to content

Instantly share code, notes, and snippets.

@quii
Created October 14, 2015 18:51
Show Gist options
  • Save quii/6f8f73df0799e9217f96 to your computer and use it in GitHub Desktop.
Save quii/6f8f73df0799e9217f96 to your computer and use it in GitHub Desktop.
package overpoker.web
import org.http4s.server._
import org.http4s.dsl._
trait HelloService{
def sayHello(name: String): String
}
object RealHelloService extends HelloService{
override def sayHello(name: String): String = s"Hello, $name"
}
object Controller {
def hello(service: HelloService) = HttpService {
case GET -> Root / "hello" / name =>
Ok(service.sayHello(name))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment