Server

@Serializable
class Server(val files: Server.Files, val port: Int = 8080, val logging: Server.Logging = Logging(), val cors: Server.Cors = Cors(), val redirects: List<Server.Redirect> = emptyList(), val streaming: Server.Streaming = Streaming(), val nativeLibraries: List<Server.NativeLibrary> = emptyList())(source)

Constructors

Link copied to clipboard
constructor(files: Server.Files, port: Int = 8080, logging: Server.Logging = Logging(), cors: Server.Cors = Cors(), redirects: List<Server.Redirect> = emptyList(), streaming: Server.Streaming = Streaming(), nativeLibraries: List<Server.NativeLibrary> = emptyList())

Types

Link copied to clipboard
@Serializable
class Cors(val hosts: List<Server.Host> = listOf())

Configuration for CORS.

Link copied to clipboard
@Serializable
class Files(val dev: Server.Files.Dev, val prod: Server.Files.Prod)

A collection of files and paths needed by the Kobweb server to serve its files.

Link copied to clipboard
@Serializable
class Host(val name: String, val schemes: List<String> = listOf("http", "https"), val subdomains: List<String> = emptyList())

A collection of host values that can be used to configure CORS.

Link copied to clipboard
@Serializable
class Logging(val level: Server.Logging.Level = Level.DEBUG, val enableConsoleLogging: Boolean = true, val enableFileLogging: Boolean = true, val logRoot: String = ".kobweb/server/logs", val clearLogsOnStart: Boolean = true, val logFileBaseName: String = "kobweb-server", val maxFileCount: Int? = null, val totalSizeCap: DataSize? = 10.mebibytes, val compressHistory: Boolean = true)

Configuration for logging.

Link copied to clipboard
@Serializable
class NativeLibrary(val name: String, val path: String)

A name-to-path mapping provided as a way for users to explicitly tell Kobweb which native library file to load.

Link copied to clipboard
@Serializable
class Redirect(val from: String, val to: String)

URL redirect mappings.

Link copied to clipboard
@Serializable
class Streaming(val pingPeriod: Duration = Duration.ZERO, val timeout: Duration = 15.seconds)

Configuration for Streaming APIs.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val port: Int = 8080
Link copied to clipboard
Link copied to clipboard