The Power of Middleware - Building Your Own Mini Web Framework on Rack
summary
Cuts Rack down to runnable plumbing: shows a small division app served via Rack middleware stack, demonstrates an inbound filter that parses hex params, an outbound filter that sprintf rounds the float, and an endpoint that validates params and returns 500 on bad input. Builds three routers: map-to-class (method_missing + eval), params-injection into query string, and middleware-as-blocks ala Sinatra. Code runs under rackup from a GitHub branch, most demos work but a couple of routes needed quick fixes.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:30Rack
- 5:57Inbound Filter
- 9:00Outbound Filter
- 10:30Endpoint
- 11:56Routing
- 12:34Map to a class
- 16:52Middleware + Params
- 20:41Middleware + Blocks
- 24:04Thoughts on Layouts/Views
- 24:59Questions?
related talks
27mHarness the power of functions to build composable rack applications
28mIn a World of Middleware, Who Needs Monolithic Applications
33mRack ‘em, Stack ‘em Web Apps
41mRack - A Framework to Roll Your Own
28mRack for web developers
22mRack Middleware as a General Purpose Abstraction
33mRack Middleware as a General Purpose Abstraction
37mRuby on Rack: The Magic Between Request and Response
