adding backend project
will try to do rest & websocket api with http4s
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user