generate 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 723774a · Browse files · 2 files·+28 added−14 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+28 added−14 removed
- other:+28 added−14 removed
Provenance
- Commit
ff7d5ff- Tree
a303d82- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
723774a
2 files changed+28 added−14 removed
modified:docs/contrib.html+2 added-3 removed
190 unmodified lines191 <li><a href="applications.html">Applications</a></li>192 </ul>193 <h3>Development Dependencies</h3>194 195-<p>Express development dependencies are stored within the <em>./support</em> directory. To196-update them execute:</p>195+<p>First install the dev dependencies by executing the following command in the repo’s directory:</p>196 198-<pre><code>$ git submodule update --init197+<pre><code>$ npm install198 </code></pre>199 200 <h3>Running Tests</h3>201 38 unmodified linesmodified:docs/guide.html+26 added-11 removed
253 unmodified lines254 255 <pre><code>$ npm install express256 </code></pre>257 258+<p>or to access the <code>express(1)</code> executable install globally:</p>259+260+<pre><code>$ npm install -g express261+</code></pre>262+263+<h2>Quick Start</h2>264+265+<p> The quickest way to get started with express is to utilize the executable <code>express(1)</code> to generate an application as shown below:</p>266+267+<p> Create the app:</p>268+269+<pre><code>$ npm install -g express270+$ express /tmp/foo && cd /tmp/foo271+</code></pre>272+273+<p> Install dependencies:</p>274+275+<pre><code>$ npm install -d276+</code></pre>277+278+<p> Start the server:</p>279+280+<pre><code>$ node app.js281+</code></pre>282+283 <h3 id="creating-a server">Creating A Server</h3>284 285 <p> To create an instance of the <em>express.HTTPServer</em>, simply invoke the <em>createServer()</em> method. With our instance <em>app</em> we can then define routes based on the HTTP verbs, in this example <em>app.get()</em>.</p>286 242 unmodified lines529 </code></pre>530 531 <p>Alternatively we can <em>use()</em> them which is useful when adding middleware within <em>configure()</em> blocks, in a progressive manor.</p>532 508-<pre><code>app.use(express.logger({ format: ':method :uri' }));533+<pre><code>app.use(express.logger({ format: ':method :url' }));534 </code></pre>535 536 <p>Typically with connect middleware you would <em>require(‘connect’)</em> like so:</p>537 258 unmodified lines796 res.send('user ' + req.user.name);797 });798 </code></pre>799 775-<p>For simple cases such as route placeholder validation and coercion we can simple pass a callback which has an arity of 1 (accepts one argument). Any errors thrown will be passed to <em>next(err)</em>.</p>776-777-<pre><code>app.param('number', function(n){ return parseInt(n, 10); });778-</code></pre>779-780-<p>We may also apply the same callback to several placeholders, for example a route GET <em>/commits/:from-:to</em> are both numbers, so we may define them as an array:</p>781-782-<pre><code>app.param(['from', 'to'], function(n){ return parseInt(n, 10); });783-</code></pre>784-800 <h3 id="view-rendering">View Rendering</h3>801 802 <p>View filenames take the form “<name>.<engine>”, where <engine> is the name803 of the module that will be required. For example the view <em>layout.ejs</em> will988 unmodified lines