Open agis opened 12 years ago
Well done, I think it's a very good wrap up of the topic. One thing I notice of your code snippet to explain how Rack package and run Middlewares which use Class object(Middleware) instead of using objects that were instantiated. Here what I think it should be:
yo_middleware = YoMiddleware.new(OurApp) # iteration 1
another_middleware = AnotherMiddleware.new(yo_middleware) # iteration 2
cool_middleware = CoolMiddleware.new(another_middleware) # iteration 3
Right. Fixed that. I wonder what @skade thinks about this. I think he's in EuRuKo atm.
One minor nitpick about the first code sample:
{"Content-Type" => "text/plain"}
Content-Length
is a mandatory header on fixed-length responses. If you use the Rack::Lint middleware, it will fail.
Otherwise, good post!
hi @Agis , Sorry but ive only just discovered this post of yours but great work! Thanks for the write up and hope the code reading projects continue to help you!
Fellow code readers, I've started a blog some days ago and I've decided it would be a good place to sum up what I've learned from our code reading session on Rack.
I haven't shared it yet, I wanted first to share it with fellow @codereading/readers so I can get opinions/corrections/general feedback etc.
I've also put a credits section in the beggining since some of the sentences are actually taken from our Issues tracker.
http://agis.heroku.com/blog/2012/05/31/hands-on-rack/