Created
October 14, 2015 18:51
-
-
Save quii/6f8f73df0799e9217f96 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
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