Skip to content

Commit

Permalink
Merge branch 'issue/KRZ-190_listen_address' into 'main'
Browse files Browse the repository at this point in the history
KRZ-190 Configurable Address and Port

See merge request reactivecore/kreuzberg!55
  • Loading branch information
nob13 committed Apr 19, 2024
2 parents dad9df4 + 1158eec commit 5179514
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ case class MiniServerConfig[F[_]](
extraJs: Seq[String] = Nil,
extraCss: Seq[String] = Nil,
extraHtmlHeader: Seq[Html] = Nil,
host: String = "0.0.0.0",
port: Int = 8090,
deploymentType: Option[DeploymentType] = None,
produktionBlacklist: Seq[String] = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MiniServer(config: MiniServerConfig[Id]) {
.fromServerEndpoints[Id](endpoints, "MiniServer", "0.1")

val server = NettyIdServer()
.host(config.host)
.port(config.port)
.addEndpoints(endpoints)
.addEndpoints(if (config.deploymentType.contains(DeploymentType.Debug)) docEndpoints else Nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class MiniServer(config: MiniServerConfig[Task]) extends ZIOAppDefault {
)
}

def serverConfigLayer: TaskLayer[Server] = Server.defaultWithPort(config.port)
def serverConfigLayer: TaskLayer[Server] = Server.defaultWith(_.binding(config.host, config.port))

def app: RIO[Server, Unit] = for {
_ <- preflightCheck
Expand Down

0 comments on commit 5179514

Please sign in to comment.