![JAR search and dependency download from the Maven repository](/logo.png)
io.undertow.Undertow.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snunit-undertow_native0.5_3 Show documentation
Show all versions of snunit-undertow_native0.5_3 Show documentation
Scala Native server using NGINX Unit
The newest version!
package io.undertow
import _root_.io.undertow.server._
import snunit.*
class Undertow private (builder: Undertow.Builder) {
private val handler: HttpHandler = builder.handler
def start(): Unit = {
SyncServerBuilder
.setRequestHandler(req => handler.handleRequest(new HttpServerExchange(req)))
.build()
.listen()
}
}
object Undertow {
final class Builder private[Undertow] () {
private[Undertow] var handler: HttpHandler = null
def addHttpListener(port: Int, host: String): Builder = this
def setHandler(handler: HttpHandler): Builder = {
this.handler = handler
this
}
def build(): Undertow = new Undertow(this)
}
def builder(): Builder = new Builder()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy