Skip to content
Ring middleware for Transit requests & responses.
Branch: master
Clone or download
Latest commit 0341199 Jul 3, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Upgrade codox to 0.9.5 Jul 3, 2016
src/ring/middleware Fixed #1: Wrong number of args (2) passed to: core/identity Nov 1, 2015
test/ring/middleware Added copyright notice. Oct 31, 2015
.gitignore Upgrade codox to 0.9.5 Jul 3, 2016
.travis.yml Upgrade codox to 0.9.5 Jul 3, 2016
LICENSE Initial commit. Oct 10, 2015
README.adoc Fixed API docs link. Oct 22, 2015
project.clj Increment version Jul 3, 2016

README.adoc

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.

You can’t perform that action at this time.