postrank-labs/goliath — pull request #204 by rsslldnphy (2012-09-14 20:47:46+00:00)
Title: MIddleware to parse Rails style url params

Hi, I've created a piece of middleware to parse Rails style URL params. It accepts a URL pattern in the same format as a rails routes file and parses out the params, adding them to the `env['params']` hash.

So for example with this in your API:

use Goliath::Rack::PathParams, '/kittens/:name/:favourite_colour'

a request path of `'/kittens/jeremy/mauve'` would lead to a params hash containing:

{ 'name' => 'jeremy', 'favourite_colour' => 'mauve' }