Closed aljimenez closed 10 years ago
I totally agree. This caused me trouble when I was writing an app with Mojito, and I wound up implementing my own contextualizing middleware that did just this.
Ok, I can fix it; it should be an easy fix. Just wanted to make sure this wasn't by design.
Pull request #1378
The context defined at start up time is not reflected per request. For example if the environment is set to "development" at startup, I would expect req.context.environment to be equal to "development" unless that request overwrites the environment dimension. Instead req.context.environment remains undefined. The mojito-contextualizer middleware should mix the static context to the request's context, giving the request's context precedence.