Skip to content

Latest commit

 

History

History
69 lines (39 loc) · 1.47 KB

README.adoc

File metadata and controls

69 lines (39 loc) · 1.47 KB

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.