ruby newbie alert! (hey that rhymes :))
I have read the official definition but still come up empty handed. What exactly is it when they say middleware? Is the purpose using ruby with https?
the smallish tutorial at patnaik’s blog makes things clearer but how do I do something with it on localhost? I have ruby 1.9.2 installed along with rack gem and mongrel server.
Do I start mongrel first? How?
Just to add a simplistic explanation of Rack (as I feel that is missing):
Rack is basically a way in which a web app can communicate with a web server. The communication goes like this:
environment– this contains mainly what the user sent in as his request – the url, the headers, whether it’s a GET or a POST, etc.statuscode which will be something like200when everything went OK and above400when something went wrong.headerswhich is information web browsers can use like information on how long to hold on to the webpage in their cache and other stuff.bodywhich is the actual webpage you see in the browser.These two steps more or less can define the whole process by which web apps work.
So a very simple Rack app could look like this: