← Back to Upcase

Any Material On Rack, Middleware and Servers?


(rjewell2200) #1

Hello, does Upcase have any material on Rack or Middleware? There’s a ton of exciting material here, but I was wondering if you guys cover important lower level details of the rails engine like Rack and the servers that communicate with Rack. Also, what about testing these lower level technologies?

Side note: I do not know why I’m only allowed to select HTTP as the category of this post, but I think Upcase would be a better category type.


(Jessie Young) #2

Hi there! I’m glad you wrote in about this because I was just thinking about writing a blog post about writing my first piece of rack middleware.

While the blog post has not been written yet, I can link you to an open source commit that I made as a result of this first middleware venture: https://github.com/fastly/fastly-rails/commit/d4f1d08cf2f51a1af4e977e22c23199268ff6b86

This includes both the middleware and a test for the middleware. I personally found testing to be the hardest part of creating my first rack middleware.

I will work on that blog post soon and link you to it when it’s done! :smile:


(rjewell2200) #3

Thank you for sharing your commit. I agree with you. Testing is the hard part. Your implementations looks great and so do your tests. Here’s a sample of my tests for a piece of middleware. I would suggest creating a mock object for the app object, the other piece of rack middleware, in your tests and just evaluate, #call, in your middleware.