在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:dream11/zio-http开源软件地址:https://github.com/dream11/zio-http开源编程语言:Scala 100.0%开源软件介绍:ZIO HttpZIO Http is a scala library for building http apps. It is powered by ZIO and netty and aims at being the defacto solution for writing, highly scalable and performant web applications using idiomatic scala. Check out the full documentation here: Documentation Table of Contents Getting StartedA simple Http server can be built using a few lines of code. import zio._
import zhttp.http._
import zhttp.service.Server
object HelloWorld extends App {
val app = Http.collect[Request] {
case Method.GET -> !! / "text" => Response.text("Hello World!")
}
override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] =
Server.start(8090, app).exitCode
} ExamplesYou can checkout more examples in the example project —
Steps to run an example
InstallationSetup via libraryDependencies += "io.d11" %% "zhttp" % "[version]"
libraryDependencies += "io.d11" %% "zhttp-test" % "[version]" % Test NOTE: ZIO Http is compatible with Watch ModeYou can use the sbt-revolver plugin to start the server and run it in watch mode using |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论