Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby.
Questions tagged [rack-middleware]
66 questions
0
votes
2 answers
What is the third argument to config.middleware.insert_before?
I have been using the following in config/environments/staging.rb to keep my staging environment private:
# HTTP Basic Authentication
if ENV['AUTH_BASIC_ON'] == 'true'
config.middleware.insert_before(ActionDispatch::Static, 'Rack::Auth::Basic',…

user664833
- 18,397
- 19
- 91
- 140
0
votes
1 answer
Sinatra middleware that converts params variable based on the CONTENT_TYPE header
I have an API endpoint that is supposed to receive either JSON or form urlencoded data. I can detect this by the accept header but I am just wondering if there is a rack middleware that does this for me already. Basically, it converts the parameter…

denniss
- 17,229
- 26
- 92
- 141
0
votes
1 answer
Rails Engines, mountable apps etc, effect of failure of one
I assume that if you mount an app in a main rails or use a rails engine. If any of the sub-apps fail/crash than that means the main app and all the sub-app fail/crash.
Does anyone know this for sure? I am wondering if I am building a system if I…

abrahamo
- 11
- 3
0
votes
2 answers
Smart way to disable/enable logs on demand in Rails
I'm running a Rails app (v 3.1.10) on a Heroku Cedar stack with Papertrail add-on going crazy because of the size of the logs.
My app is really verbose and the logs are getting huge (really huge):
Sometimes because I serialize a lots of data in one…

fro_oo
- 1,610
- 4
- 24
- 46
0
votes
0 answers
Share Session/Hash with Rack application
I'm very new with Rack and I'm playing around with it, I would love to share some session or hash table among all my rack apps,
Let's say I have the following config.ru
require "rack"
require "./my_app.rb"
require "./auth.rb"
use…

Eqbal
- 1,819
- 2
- 16
- 25
0
votes
1 answer
Getting rack error Rack::Lint::LintError: Status must be >=100 seen as integer
I'm trying to build my rack based ruby app, and I'm still new here, I'm using ruby 1.9.2 -p180
in my config.ru file I have:
require "rack"
require "./my_app.rb"
require "./auth.rb"
use Auth
run MyApp.new
Now main problem with Middleware Auth,…

Eqbal
- 1,819
- 2
- 16
- 25