Skip to content

Instantly share code, notes, and snippets.

@joshmn joshmn/config.ru
Last active Jun 5, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.