Skip to content

Instantly share code, notes, and snippets.

@joshmn
Last active June 5, 2018 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshmn/66f715c65bc19784f95a0e2ce3c9df93 to your computer and use it in GitHub Desktop.
Save joshmn/66f715c65bc19784f95a0e2ce3c9df93 to your computer and use it in GitHub Desktop.
this rack app will return whatever http status code you want, too.
# https://gist.github.com/wwalexander/febbc1ba76c8eafa9f94f5cb2573b34d
# https://news.ycombinator.com/item?id=17235270
#
# Make sure this is named config.ru
# install the gem with
# $ gem install rack
#
# Usage: rackup
require 'rack'
run ->(env) { [(env['REQUEST_PATH'][-3, 3].to_i.nonzero? ? env['REQUEST_PATH'][-3, 3].to_i : 200), {"Content-Type" => "text/html"}, [' ']] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment