adding backend project

will try to do rest & websocket api with http4s
This commit is contained in:
efim
2023-04-23 11:12:08 +04:00
parent 7e488b7e62
commit d8af92787d
6 changed files with 70 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
package industries.sunshine.planningpoker
import cats.effect._
import cats.syntax.all._
import org.http4s._, org.http4s.dsl.io._, org.http4s.implicits._
import com.comcast.ip4s._
import org.http4s.HttpRoutes
import org.http4s.dsl.io._
import org.http4s.implicits._
import org.http4s.ember.server._
object App extends IOApp.Simple {
val service = HttpRoutes
.of[IO] { case _ =>
Ok("hello")
}
.orNotFound
override def run: IO[Unit] = {
val a = 1
IO.println(s"Hello, World! $a") >>
EmberServerBuilder
.default[IO]
.withHost(ipv4"0.0.0.0")
.withPort(port"8080")
.withHttpApp(service)
.build
.use(_ => IO.never)
.as(ExitCode.Success)
}
}