Rack basics

Rack is a Ruby webserver interface. It was intended to provide minimal API for connecting web servers and web frameworks. Creator, Christian Neukirchen's Introducing Rack

A rack app is an object which implements two required behaviours:

  1. It responds to #call, and takes an environment hash as a param.
  2. It returns an array of; [status number, headers hash, enumberable content]

In its simplest form

  lambda { |env| [200, {'Content-Type' => 'text/html'}, ["Hello world!"]] }