Created
November 11, 2015 13:30
-
-
Save vkostyukov/861abc1d6f86272cf5be to your computer and use it in GitHub Desktop.
HelloWorld
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
import com.twitter.finagle.Http | |
import com.twitter.util.{Future, Await} | |
import io.finch._ | |
object Test1 extends App { | |
implicit val encodeMap: EncodeResponse[Map[String, String]] = | |
EncodeResponse("text/plain")(map => | |
Buf.Utf8(map.toSeq.map(kv => kv._1 + ":" + kv._2).mkString("\n")) | |
) | |
val service = get("hello") { Ok("Hello") } | |
Await.ready(Http.server.serve(":8080", service.toService)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment