aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2020-02-25 12:51:50 +0100
committerRobert Jaros <rjaros@finn.pl>2020-02-25 12:51:50 +0100
commitcd51c65b8f61112703fa5995b5585a1109aab8a4 (patch)
treef948a00e3dc073806f93274bb80c4f88110a8bd0
parent3dd84bb59a119afba9fd5bcb84c15e214daa8d3d (diff)
downloadkvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.tar.gz
kvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.tar.bz2
kvision-cd51c65b8f61112703fa5995b5585a1109aab8a4.zip
Upgrade to Jooby 2.x - support for custom guice modules
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVModules.kt5
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())
}