Skip to content

neotyk/status-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

status-codes

Easy response status codes for compojure. Get it from Clojars.

Usage

leiningen

[status-codes "0.5"]

compojure

(use 'status-codes.compojure
     '[compojure.core :only [GET routes]])
(routes
   (GET "/ok"           _ :ok)
   (GET "/accepted"     _ :accepted)
   (GET "/ok-map"       _ {:status :ok})
   (GET "/accepted-map" _ {:status :accepted}))

ring middleware

(use 'status-codes.middleware)
(defn handler [req]
  ;; your handling code that can use keyword status codes
  {:status :accepted ..})

;; wrap your handler in status-codes middleware
(def app
  (-> handler
    wrap-status-codes
    ;; other wrappers that you need
    ))

License

Copyright (C) 2011 Hubert Iwaniuk

Distributed under the Eclipse Public License, the same as Clojure.

About

Keyword status codes for ring and compojure.

Resources

Stars

Watchers

Forks

Packages

No packages published