Mokksy

expect fun Mokksy(host: String = DEFAULT_HOST, port: Int = 0, verbose: Boolean = false, configurer: Application.() -> Unit = {}): MokksyServer(source)

Creates a MokksyServer — idiomatic Kotlin entry point for all platforms.

Example:

val mokksy = Mokksy()
mokksy.startSuspend()
mokksy.get { path("/ping") } respondsWith { body = "Pong" }
mokksy.shutdownSuspend()

On JVM, dev.mokksy.mokksy.start and dev.mokksy.mokksy.shutdown blocking extensions are also available:

val mokksy = Mokksy().start()

Java callers should use dev.mokksy.Mokksy.create instead.

Parameters

host

The host to bind to. Defaults to 127.0.0.1.

port

The port to bind to. Defaults to 0 (randomly assigned).

verbose

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

configurer

Additional Ktor Application configuration applied after the default routing setup.

actual fun Mokksy(host: String, port: Int, verbose: Boolean, configurer: Application.() -> Unit): MokksyServer(source)

Creates a MokksyServer — idiomatic Kotlin entry point for all platforms.

Example:

val mokksy = Mokksy()
mokksy.startSuspend()
mokksy.get { path("/ping") } respondsWith { body = "Pong" }
mokksy.shutdownSuspend()

On JVM, dev.mokksy.mokksy.start and dev.mokksy.mokksy.shutdown blocking extensions are also available:

val mokksy = Mokksy().start()

Java callers should use dev.mokksy.Mokksy.create instead.

Parameters

host

The host to bind to. Defaults to 127.0.0.1.

port

The port to bind to. Defaults to 0 (randomly assigned).

verbose

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

configurer

Additional Ktor Application configuration applied after the default routing setup.

actual fun Mokksy(host: String, port: Int, verbose: Boolean, configurer: Application.() -> Unit): MokksyServer(source)

Creates a MokksyServer — idiomatic Kotlin entry point for all platforms.

Example:

val mokksy = Mokksy()
mokksy.startSuspend()
mokksy.get { path("/ping") } respondsWith { body = "Pong" }
mokksy.shutdownSuspend()

On JVM, dev.mokksy.mokksy.start and dev.mokksy.mokksy.shutdown blocking extensions are also available:

val mokksy = Mokksy().start()

Java callers should use dev.mokksy.Mokksy.create instead.

Parameters

host

The host to bind to. Defaults to 127.0.0.1.

port

The port to bind to. Defaults to 0 (randomly assigned).

verbose

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

configurer

Additional Ktor Application configuration applied after the default routing setup.

actual fun Mokksy(host: String, port: Int, verbose: Boolean, configurer: Application.() -> Unit): MokksyServer(source)

Creates a MokksyServer — idiomatic Kotlin entry point for all platforms.

Example:

val mokksy = Mokksy()
mokksy.startSuspend()
mokksy.get { path("/ping") } respondsWith { body = "Pong" }
mokksy.shutdownSuspend()

On JVM, dev.mokksy.mokksy.start and dev.mokksy.mokksy.shutdown blocking extensions are also available:

val mokksy = Mokksy().start()

Java callers should use dev.mokksy.Mokksy.create instead.

Parameters

host

The host to bind to. Defaults to 127.0.0.1.

port

The port to bind to. Defaults to 0 (randomly assigned).

verbose

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

configurer

Additional Ktor Application configuration applied after the default routing setup.