WardCunningham/Smallest-Federated-Wiki — pull request #221 by harlantwood (2012-05-07 03:54:48+00:00)
Title: Heroku support

I've come up with a somewhat cleaner way to support recursive calls on heroku, which also allows for more efficient serving of json and favicons that are already on the local server (ie it is useful for non-heroku hosts too).

By setting the env var:

FARM_DOMAINS=my-sfw-farm.org

You are instructing your server to handle "remote" calls locally for all subdomains of `my-sfw-farm.org`.

I did a fair bit of refactoring along the way, including moving the server helpers into their own module, to allow [rspec testing of the new helper method](https://github.com/harlantwood/Smallest-Federated-Wiki/compare/2eb21d7...b05ac6e#diff-9) `#serve_resources_locally?`.

I also pulled out a `serve_page` helper, now that it is used in two places, as well as `Favicon#get_or_create`, same story.

The [changes in CouchStore](https://github.com/harlantwood/Smallest-Federated-Wiki/compare/2eb21d7...b05ac6e#diff-7) is a refactoring teased out by the previous approach (seeing if there are any pages present for the given server), but I've left it in place because it is clearer code.