ServerConfiguration

data class ServerConfiguration @JvmOverloads constructor(val verbose: Boolean = false, val name: String? = "Mokksy", val journalMode: JournalMode = JournalMode.LEAN, val json: Json = Json { ignoreUnknownKeys = true }, val contentNegotiationConfigurer: (ContentNegotiationConfig) -> Unit = { it.json(json) })(source)

Configuration for a MokksyServer instance.

Constructors

Link copied to clipboard
constructor(verbose: Boolean = false, name: String? = "Mokksy", journalMode: JournalMode = JournalMode.LEAN, json: Json = Json { ignoreUnknownKeys = true }, contentNegotiationConfigurer: (ContentNegotiationConfig) -> Unit = { it.json(json) })

Properties

Link copied to clipboard

Configures the Ktor ContentNegotiationConfig installed on the server. Defaults to installing json as the JSON codec.

Link copied to clipboard

Controls which requests are recorded in the dev.mokksy.mokksy.request.RequestJournal. Defaults to JournalMode.LEAN (only unmatched requests). Supported: JournalMode.NONE, JournalMode.LEAN, JournalMode.FULL.

Link copied to clipboard
val json: Json

The Json instance used for both content negotiation and response body logging. Defaults to Json { ignoreUnknownKeys = true }. Provide a custom instance to share serializers modules (e.g. for polymorphic types) between deserialization and the verbose debug formatter.

Link copied to clipboard
val name: String?

Human-readable server name used in log output. Defaults to "Mokksy".

Link copied to clipboard

Enables DEBUG-level request logging when true. Defaults to false.