Configuration docs
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 83d2555 · Browse files · 3 files·+83 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
3 files+83 added−1 removed
- other:+83 added−1 removed
Provenance
- Commit
cb04364- Tree
e303d60- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
83d2555
3 files changed+83 added−1 removed
modified:docs/guide.1+34 added
169 unmodified lines170 .171 .fi172 .173 .IP "" 0174+.175+.P176+For internal and arbitrary settings Express provides the \fIset(key[, val])\fR, \fIenable(key)\fR, \fIdisable(key)\fR methods:177+.178+.IP "" 4179+.180+.nf181 182+app\.configure(function(){183+ app\.set(\'views\', __dirname + \'/views\');184+ app\.set(\'views\');185+ // => \"\.\.\. views directory \.\.\.\"186+187+ app\.enable(\'some feature\');188+ // same as app\.set(\'some feature\', true);189+190+ app\.disable(\'some feature\');191+ // same as app\.set(\'some feature\', false);192+});193+.194+.fi195+.196+.IP "" 0197+.198+.SS "Settings"199+Express supports the following settings out of the box:200+.201+.IP "\(bu" 4202+\fIviews\fR Root views directory defaulting to \fBCWD/views\fR203+.204+.IP "\(bu" 4205+\fIview engine\fR Default view engine name for views rendered without extensions206+.207+.IP "" 0208+modified:docs/guide.html+25 added
284 unmodified lines285 app.use('/', connect.errorHandler());286 });287 </code></pre>288 289+<p>For internal and arbitrary settings Express provides the <em>set(key[, val])</em>, <em>enable(key)</em>, <em>disable(key)</em> methods:</p>290+291+<pre><code>app.configure(function(){292+ app.set('views', __dirname + '/views');293+ app.set('views');294+ // => "... views directory ..."295+296+ app.enable('some feature');297+ // same as app.set('some feature', true);298+299+ app.disable('some feature');300+ // same as app.set('some feature', false);301+});302+</code></pre>303+304+<h3 id="Settings">Settings</h3>305+306+<p>Express supports the following settings out of the box:</p>307+308+<ul>309+<li><em>views</em> Root views directory defaulting to <strong>CWD/views</strong></li>310+<li><em>view engine</em> Default view engine name for views rendered without extensions</li>311+</ul>312+313+314 </div>315 </div>316 </div>317 </body>1 unmodified linemodified:docs/guide.md+24 added-1 removed
113 unmodified linesExpand all114115116117118118119120121122123124125126127128129130131132133134135136137138139140141113 unmodified linesExpand all }); app.configure('production', function(){ app.use('/', connect.errorHandler()); });No newline at end of file });
For internal and arbitrary settings Express provides the _set(key[, val])_, _enable(key)_, _disable(key)_ methods:
app.configure(function(){ app.set('views', __dirname + '/views'); app.set('views'); // => "... views directory ..." app.enable('some feature'); // same as app.set('some feature', true); app.disable('some feature'); // same as app.set('some feature', false); });
### Settings
Express supports the following settings out of the box:
* _views_ Root views directory defaulting to **CWD/views** * _view engine_ Default view engine name for views rendered without extensions
No newline at end of file