Adding a local-only middleware.

Taken from blank-canvas