Skip to content

Rack middleware replacing status codes with relevant pictures of dogs

Notifications You must be signed in to change notification settings

mikeleeorg/status_dogs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Status Dogs Build Status

Rack middleware replacing responses with relevant pictures of dogs, based on the status code.

The pictures are made/collected by Mike Lee on HTTP Status Dogs.

This is a shameless fork of status_cats by Iain Hecker.

Usage

Install:

gem install status_dogs

Place inside your rackup file:

require 'status_dogs'
use StatusDogs

This will also replace valid responses, even 200, basically making your application useless.

You can manage which status codes should be replaced with dogs, by using the :only and :except options, which take arrays or ranges.

use StatusDogs, :only => [ 403, 404, 500 ]

# or ...

use StatusDogs, :except => 200...300

Development

Install dependencies:

bundle install

Run tests:

rake

You can run the demo application:

bundle exec rackup

The application will trigger the response code depending on the path you visit, so visiting http://localhost:9292/418 will respond with a teapot.

Known issues

Status codes 100 (Continue), 204 (No Content) and 304 (Not Modified) cannot have a response body. Triggering them will cause Rack to throw up.

License

The Ruby code in this project is released under the MIT License.

The pictures of dogs are copywrited by Mike Lee from http://httpstatusdogs.com/

About

Rack middleware replacing status codes with relevant pictures of dogs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%