Skip to content
Myr

Added "request", "response", and "app" locals

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent bf06d90 · Browse files · 2 files+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−1 removed

  • other:+13 added−1 removed

2 files+13 added−1 removed

modified:docs/guide.md+3 added
1143 unmodified lines
1144Express also provides a few locals by default:11451146 - `settings` the app's settings object1147 - `filename` the view's filename1148 - `request` the request object1149 - `response` the response object1150 - `app` the application itself11511152This method is aliased as _app.locals()_.11531154### app.dynamicHelpers(obj)
85 unmodified lines
modified:lib/http.js+10 added-1 removed
82 unmodified lines
83 return fn;84 });8586 // default locals87 this.locals({ settings: this.settings });87 this.locals({88 settings: this.settings89 , app: this90 });9192 // default dynamic locals93 this.dynamicHelpers({94 request: function(req, res){ return req; }95 , response: function(req, res){ return res; }96 });9798 // default development configuration99 this.configure('development', function(){100 this.enable('hints');101 });
375 unmodified lines