diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-10-08 22:11:21 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-10-08 22:11:21 +0200 |
commit | 470953c78c2509224bb452c16f8bbea54e53b3d7 (patch) | |
tree | e67b9c03d09bb9ff61b387f6267bdeb2eac48b5b /kvision-modules/kvision-server-jooby/src/main/kotlin | |
parent | eddd58f3f31954809645bdf2222833424c3f9a73 (diff) | |
download | kvision-470953c78c2509224bb452c16f8bbea54e53b3d7.tar.gz kvision-470953c78c2509224bb452c16f8bbea54e53b3d7.tar.bz2 kvision-470953c78c2509224bb452c16f8bbea54e53b3d7.zip |
Better server class abstraction.
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin')
-rw-r--r-- | kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt (renamed from kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt) | 2 | ||||
-rw-r--r-- | kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt index 928892a2..76f1ee30 100644 --- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt +++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt @@ -36,7 +36,7 @@ import kotlinx.coroutines.async as coroutinesAsync /** * A Jooby based server. */ -actual open class JoobyServer(init: JoobyServer.() -> Unit) : Kooby() { +actual open class KVServer(init: KVServer.() -> Unit) : Kooby() { init { @Suppress("LeakingThis") assets("/", "index.html") diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt index edaa9ba3..b37d7319 100644 --- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt +++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt @@ -39,7 +39,7 @@ actual open class ServiceManager<out T> actual constructor(val service: T) { val LOG: Logger = LoggerFactory.getLogger(ServiceManager::class.java.name) } - protected val routes: MutableList<JoobyServer.() -> Unit> = mutableListOf() + protected val routes: MutableList<KVServer.() -> Unit> = mutableListOf() val mapper = jacksonObjectMapper() var counter: Int = 0 @@ -299,7 +299,7 @@ actual open class ServiceManager<out T> actual constructor(val service: T) { method: RpcHttpMethod, path: String, handler: (Request, Response) -> Unit - ): JoobyServer.() -> Unit { + ): KVServer.() -> Unit { return { when (method) { RpcHttpMethod.POST -> post(path, handler) @@ -322,9 +322,9 @@ actual open class ServiceManager<out T> actual constructor(val service: T) { /** * Applies all defined routes to the given server. - * @param k a Jooby server + * @param k a server */ - actual fun applyRoutes(k: JoobyServer) { + actual fun applyRoutes(k: KVServer) { routes.forEach { it.invoke(k) } |