From e710b4b05fb27b3a826104df431fccd6845d414b Mon Sep 17 00:00:00 2001 From: Travis Jeffery Date: Sun, 30 Aug 2015 22:20:22 -0500 Subject: [PATCH] add app.context docs --- docs/api/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/api/index.md b/docs/api/index.md index 3c78db8..584d117 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -162,6 +162,15 @@ app.keys = new KeyGrip(['im a newer secret', 'i like turtle'], 'sha256'); this.cookies.set('name', 'tobi', { signed: true }); ``` +## app.context + + The recommended namespace to extend with information that's useful + throughout the lifetime of your application, as opposed to a per request basis. + +```js +app.context.db = db(); +``` + ## Error Handling By default outputs all errors to stderr unless __NODE_ENV__ is "test". To perform custom error-handling logic such as centralized logging you