https://github.com/yogthos/ring-http-cat-status
Ring middleware for serving status images from https://http.cat/
https://github.com/yogthos/ring-http-cat-status
Last synced: 10 months ago
JSON representation
Ring middleware for serving status images from https://http.cat/
- Host: GitHub
- URL: https://github.com/yogthos/ring-http-cat-status
- Owner: yogthos
- License: epl-1.0
- Created: 2016-07-15T15:49:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-15T23:50:53.000Z (over 9 years ago)
- Last Synced: 2024-10-29T08:22:33.414Z (about 1 year ago)
- Language: Clojure
- Size: 5.86 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ring-http-cat-status
A Clojure library designed to serve HTTP status images from [https://http.cat/](https://http.cat/).
## Usage
[](https://clojars.org/ring-http-cat-status)
The library provides a `wrap-cat-http-status` function that will return an
image from [https://http.cat/](https://http.cat/) based on the response status code
for any response that's not in 200 range.
```clojure
(myapp.middleware
(:require [ring-http-cat-status.middleware :refer [wrap-cat-http-status]]))
(defn bad-hanlder [request]
{:status 500
:headers {"Content-Type" "text/plain"}
:body "oops"})
(wrap-cat-http-status bad-handler)
```
## License
Copyright © 2016 Dmitri Sotnikov
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.