senchalabs/connect — pull request #999 by juanpaco (2014-01-18 13:43:55+00:00)
Title: Allow a fallback file option

Suppose you are serving profile images, and not all of your users have supplied profile images. Rather than hitting your application code on the image fetch to determine if the image exists, you can specify a default blank avatar.

This PR adds a fallback option that allows users to specify a file path to serve if the originally requested file is not present. If the fallback is also not present, it 404s as normal.

This was inspired by a SO question: http://stackoverflow.com/questions/21198790/how-to-serve-static-profile-images-in-node

This PR does not function without this corresponding PR in send: https://github.com/visionmedia/send/pull/33