From f21ef567f03618b1b6b98795882343918aa4c2e1 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 3 Dec 2024 15:40:54 +0100 Subject: [PATCH] Fix url prefix --- .../jvmMain/kotlin/io/kvision/remote/KVController.kt | 10 +++++----- .../kotlin/io/kvision/remote/KVSseController.kt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVController.kt b/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVController.kt index ee3528f68c..6154c57ddc 100644 --- a/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVController.kt +++ b/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVController.kt @@ -56,7 +56,7 @@ open class KVController { @Get("/{+path}") suspend fun get(@PathVariable path: String?, request: HttpRequest<*>): HttpResponse = - handle(HttpMethod.GET, "/rpc/$path", request) + handle(HttpMethod.GET, "/kv/$path", request) @Suppress("UNUSED_PARAMETER") @Post("/{+path}") @@ -64,7 +64,7 @@ open class KVController { @PathVariable path: String?, request: HttpRequest<*>, @Body body: JsonRpcRequest - ): HttpResponse = handle(HttpMethod.POST, "/rpc/$path", request) + ): HttpResponse = handle(HttpMethod.POST, "/kv/$path", request) @Suppress("UNUSED_PARAMETER") @Put("/{+path}") @@ -72,7 +72,7 @@ open class KVController { @PathVariable path: String?, request: HttpRequest<*>, @Body body: JsonRpcRequest - ): HttpResponse = handle(HttpMethod.PUT, "/rpc/$path", request) + ): HttpResponse = handle(HttpMethod.PUT, "/kv/$path", request) @Suppress("UNUSED_PARAMETER") @Delete("/{+path}") @@ -80,7 +80,7 @@ open class KVController { @PathVariable path: String?, request: HttpRequest<*>, @Body body: JsonRpcRequest - ): HttpResponse = handle(HttpMethod.DELETE, "/rpc/$path", request) + ): HttpResponse = handle(HttpMethod.DELETE, "/kv/$path", request) @Suppress("UNUSED_PARAMETER") @Options("/{+path}") @@ -88,7 +88,7 @@ open class KVController { @PathVariable path: String?, request: HttpRequest<*>, @Body body: JsonRpcRequest - ): HttpResponse = handle(HttpMethod.OPTIONS, "/rpc/$path", request) + ): HttpResponse = handle(HttpMethod.OPTIONS, "/kv/$path", request) private suspend fun handle(method: HttpMethod, path: String, request: HttpRequest<*>): HttpResponse { val handler = kvManagers.services.asSequence().mapNotNull { diff --git a/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVSseController.kt b/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVSseController.kt index cf4e814b4d..cf0b6138a9 100644 --- a/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVSseController.kt +++ b/kvision-modules/kvision-server-micronaut/src/jvmMain/kotlin/io/kvision/remote/KVSseController.kt @@ -57,7 +57,7 @@ open class KVSseController { @ExecuteOn(TaskExecutors.IO) @Get("/{+path}", produces = [MediaType.TEXT_EVENT_STREAM]) fun getSse(@PathVariable path: String?, request: HttpRequest<*>): Publisher> = - handleSse("/rpcsse/$path", request) + handleSse("/kvsse/$path", request) private fun handleSse(path: String, request: HttpRequest<*>): Publisher> { val handler = kvManagers.services.asSequence().mapNotNull {