From f555cf807551fa0f646c57642a46f63d95242d24 Mon Sep 17 00:00:00 2001 From: Gleb <31935368+lobzison@users.noreply.github.com> Date: Mon, 17 Oct 2022 17:15:51 +0200 Subject: [PATCH] Update Hello World example --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4eec689c4..198527ffc 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,14 @@ Hello World! This "Hello World!" example is built with just `finch-core`: ```scala -import io.finch._, cats.effect.IO -import com.twitter.finagle.Http -import com.twitter.util.Await - -object Main extends App with Endpoint.Module[IO] { - val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") } - Await.ready(Http.server.serve(":8080", api.toServiceAs[Text.Plain])) +import cats.effect.{IO, IOApp} +import io.finch._ + +object Main extends IOApp.Simple with Endpoint.Module[IO] { + override def run: IO[Unit] = { + val api: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") } + Bootstrap[IO].serve[Text.Plain](api).listen(":8080").useForever + } } ```