|
@@ -5,20 +5,20 @@ import com.twitter.finagle.Service
|
|
|
import com.twitter.finagle.stack.nilStack
|
|
|
import com.twitter.util.Await
|
|
|
|
|
|
+import cats.effect.IO
|
|
|
import io.circe.Json
|
|
|
import io.finch._
|
|
|
-import io.finch.syntax._
|
|
|
import io.finch.circe._
|
|
|
|
|
|
-object Main extends App {
|
|
|
+object Main extends App with Endpoint.Module[IO] {
|
|
|
|
|
|
val helloWorld: Buf = Buf.Utf8("Hello, World!")
|
|
|
|
|
|
- val json: Endpoint[Json] = get("json") {
|
|
|
+ val json: Endpoint[IO, Json] = get("json") {
|
|
|
Ok(Json.obj("message" -> Json.fromString("Hello, World!")))
|
|
|
}
|
|
|
|
|
|
- val plaintext: Endpoint[Buf] = get("plaintext") {
|
|
|
+ val plaintext: Endpoint[IO, Buf] = get("plaintext") {
|
|
|
Ok(helloWorld)
|
|
|
}
|
|
|
|