diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-02-18 17:10:10 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-02-18 17:10:10 +0100 |
commit | 667b3f983a3a77865e4fb89c0cf531ce982904ac (patch) | |
tree | a65572ca6ee9ee728d8fbe8b50bc18d866316cfb /kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote | |
parent | 29f0867506334d0f7387f654e7d84b6840a1ad86 (diff) | |
download | kvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.tar.gz kvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.tar.bz2 kvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.zip |
Make kvision-remote module independent of kvision itself.
Change the default JSON serialization format of Date objects (plain long value).
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote')
2 files changed, 2 insertions, 12 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 9ae6d0e7..34b2877f 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,17 +21,11 @@ */ package pl.treksoft.kvision.remote -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import org.jooby.Kooby import org.jooby.json.Jackson -import pl.treksoft.kvision.types.KV_JSON_DATE_FORMAT -import java.text.SimpleDateFormat fun Kooby.kvisionInit() { assets("/", "/assets/index.html") assets("/**", "/assets/{0}").onMissing(0) - val mapper = jacksonObjectMapper().apply { - dateFormat = SimpleDateFormat(KV_JSON_DATE_FORMAT) - } - use(Jackson(mapper)) + use(Jackson()) } diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 456bb901..d1e64ce4 100644 --- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -31,8 +31,6 @@ import org.jooby.Request import org.jooby.Response import org.slf4j.Logger import org.slf4j.LoggerFactory -import pl.treksoft.kvision.types.KV_JSON_DATE_FORMAT -import java.text.SimpleDateFormat import kotlin.reflect.KClass /** @@ -46,9 +44,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: } val routes: MutableList<Kooby.() -> Unit> = mutableListOf() - val mapper = jacksonObjectMapper().apply { - dateFormat = SimpleDateFormat(KV_JSON_DATE_FORMAT) - } + val mapper = jacksonObjectMapper() var counter: Int = 0 /** |