Skip to content

stask/micro-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micro-middleware

Collection of small middlewares.

wrap-json-params

Parses request body as JSON if content type is 'application/json'. If :hyphenize is true, will replace underscores with hyphens in keys. Default is false. Will decompress body before parsing if 'Content-Encoding' is 'gzip'.

(-> routes
    ...; other middlewares
    (wrap-json-params :hyphenize true))

See tests for more examples

wrap-json-response

Converts body (array or hashmap) to JSON string if client accepts json. If :dehyphenize is true, will replace hyphens with underscores in keys. Default is false. Has custom formatter for joda time.

(-> routes
    ...; other middlewares
    (wrap-json-response :dehyphenize true))

See tests for more examples

About

Collection of simple clojure ring middlewares

Resources

Stars

Watchers

Forks

Packages

No packages published