ring-transit-middleware

Ring middleware for Transit request & responses.


License
MIT

Documentation

ring-transit-middleware

Build Status API Documentation

Ring middleware for Transit requests & responses.

Latest Release

Leiningen

Add this to your :dependencies in project.clj:

Clojars Project

Usage

Defaults should work fine for most use cases:

(require '[ring.middleware.transit :refer [wrap-transit]])


(defn handler [request]
  (let [username (get-in request [:params :username])]
    {:hello username}))


(defn app
  (-> handler
      (wrap-transit)))

The handler above would accept transit requests and it would encode clojure data structures like maps and vectors into transit. See API documentation for more info.

wrap-transit also accepts an options map, see API documentation for more info.

Aleph

wrap-transit is compatible with Aleph's deferred responses. It should just work out of the box.

See Also

License

Copyright © 2015 Atamert Ölçgen

Distributed under The MIT License, same as Ring. See LICENSE file.