Skip to content

Instantly share code, notes, and snippets.

@tkharris
Last active August 29, 2015 14:02
Show Gist options
  • Save tkharris/0e2fc4a53292a3d438da to your computer and use it in GitHub Desktop.
Save tkharris/0e2fc4a53292a3d438da to your computer and use it in GitHub Desktop.
require 'sinatra';set port: ARGV[0]||80;%w.get post put patch options delete..map{|v|send(v,'*'){503}}
@ifo
Copy link

ifo commented Jun 20, 2014

I would recommend replacing get('*'){503} with %w[get put post delete options patch].map{|m| send(m, '*'){503}} so you can respond to all types of requests with 503.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment