CrossClj

0.1.3 docs

SourceDocs



RECENT

    ring-transit-middleware

    Clojars

    Jul 3, 2016


    OWNER
    Atamert Ölçgen
    muhuk@muhuk.com
    www.muhuk.com

    Index of all namespaces


    « Project + dependencies

    Ring middleware for Transit request & responses.

    ring.middleware.transitDocsSource
    Ring middleware for Transit requests & responses.
    
    For basic usage you just need to add [[wrap-transit]]
    middleware.
    
    #### Usage Example:
    
        (require '[ring.middleware.transit :refer [wrap-transit]])
    
    
        (defn handler [request]
          (let [username (get-in request [:params :username])]
            {:hello username}))
    
    
        (defn app
          (-> handler
              (wrap-transit)))
    
    
    [[encode]] & [[decode]] are provided for reusing of options to
    [[wrap-transit]] when encoding/decoding Transit outside of
    HTTP requests/responses. When using WebSockets or
    communicating with other services.
    
    If you want to write a custom middleware based on this code
    take a look at -decode-request & -encode-response functions.
    They are not documented.