Adding a local-only middleware.

Taken from blank-canvas
Merge pull request #268 from andygill/master

Adding a local-only middleware.