diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-02-25 12:51:50 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-02-25 12:51:50 +0100 |
commit | cd51c65b8f61112703fa5995b5585a1109aab8a4 (patch) | |
tree | f948a00e3dc073806f93274bb80c4f88110a8bd0 /kvision-modules/kvision-server-jooby/src/main/kotlin/pl | |
parent | 3dd84bb59a119afba9fd5bcb84c15e214daa8d3d (diff) | |
download | kvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.tar.gz kvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.tar.bz2 kvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.zip |
Upgrade to Jooby 2.x - support for custom guice modules
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin/pl')
-rw-r--r-- | kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt | 5 |
1 files changed, 3 insertions, 2 deletions
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()) } |