/clj-jsonrpc

A simple JSON-RPC 2.0 library for Clojure

Primary LanguageClojureEclipse Public License 1.0EPL-1.0

clj-jsonrpc

A Clojure library for JSON-RPC 2.0 protocol

Usage

Leiningen/Boot

[clj-jsonrpc "0.1.1-dev"]  ;; use the latest version number

Gradle

compile "clj-jsonrpc:clj-jsonrpc:${version-number}"

Maven

<dependency>
  <groupId>clj-jsonrpc</groupId>
  <artifactId>clj-jsonrpc</artifactId>
  <version>${version-number}</version>
</dependency>

Demo Usage

(def rpc-handlers {
               :sum (fn [& params] (apply + params))
               })

(jsonrpc/defhandlers rpc-server/rpc-conn
                     rpc-handlers)

(defn run-jetty-demo-server [& args]
  (println "hello, jetty demo")
  (run-jetty #'rpc-server/app {:port 8080}))
  

License

Copyright © 2017 zoowii

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.