Aspen allows for a full WSGI middleware stack, configured via the __/etc/middleware.conf file. This is simply a newline-separated list of middleware factories in colon notation. Each factory (which may be a class constructor or other callable) is called with exactly one positional argument, the next middleware on the stack. The first-mentioned middleware will therefore be the outer-most in the stack (i.e., closest to the browser).
example.foo:bar # closest to browser example.baz:buz # closest to your apps/handlers
Aspen is copyright © 2006-2007 by Chad Whitacre and contributors, and is offered under the MIT license.