org.http4k.core.configExt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-config Show documentation
Show all versions of http4k-config Show documentation
Machinery for configuring Http4k apps in a typesafe way
package org.http4k.core
import org.http4k.config.Authority
import org.http4k.config.Environment
import org.http4k.config.Host
import org.http4k.config.Port
fun Uri.port(port: Port?) = port(port?.value)
fun Uri.port() = port?.let(::Port)
fun Uri.host() = Host(host)
fun Uri.host(host: Host) = host(host.value)
fun Uri.authority(authority: Authority) = host(authority.host).port(authority.port)
fun Uri.authority() = Authority(host(), port())
fun Environment.with(vararg modifiers: (Environment) -> Environment) = modifiers.fold(this) { memo, next -> next(memo) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy