From cd51c65b8f61112703fa5995b5585a1109aab8a4 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 25 Feb 2020 12:51:50 +0100 Subject: Upgrade to Jooby 2.x - support for custom guice modules --- .../src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin/pl') diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt index 73fcdadb..82ede003 100644 --- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt +++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt @@ -21,6 +21,7 @@ */ package pl.treksoft.kvision.remote +import com.google.inject.Module import io.jooby.AssetSource import io.jooby.Kooby import io.jooby.di.GuiceModule @@ -29,9 +30,9 @@ import io.jooby.json.JacksonModule /** * Initialization function for Jooby server. */ -fun Kooby.kvisionInit() { +fun Kooby.kvisionInit(vararg modules: Module) { assets("/", "/assets/index.html") assets("/*", AssetSource.create(javaClass.classLoader, "assets")) - install(GuiceModule()) + install(GuiceModule(*modules)) install(JacksonModule()) } -- cgit