1

According http4k documentation to configure JSON-RPC server I should use JsonRpc.auto or JsonRpc.manual, but unfortunately I can't find any example. API doc contains something like:

fun <NODE : Any> auto(json: JsonLibAutoMarshallingJson<NODE>, errorHandler: ErrorHandler = defaultErrorHandler, fn: Auto<NODE>.() -> Unit): JsonRpcService<NODE>

and I don't know, which implementations of interfaces I should use.

fun main() {
    val app: HttpHandler = JsonRpc.auto(???)
    app.asServer(Jetty(8080)).start()
}

Ashvin solanki
  • 4,802
  • 3
  • 25
  • 65

1 Answers1

1

Looks like there were some missing docs. There is now an example on the site, but in future the best port of call is to look at the tests first. :)

Here's the example: https://www.http4k.org/guide/modules/jsonrpc/

David D
  • 239
  • 2
  • 4