Skip to content
Myr

Merge branch 'master' of github.com:visionmedia/express

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 · parents 579836e, ddce65b · Browse files · 2 files+5 added−5 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+5 added−5 removed

  • other:+5 added−5 removed

2 files+5 added−5 removed

modified:docs/guide.html+3 added-3 removed
530 unmodified lines
531 , express.bodyParser()532 );533</code></pre>534535<p>Alternatively we can <em>use()</em> them which is useful when adding middleware within <em>configure()</em> blocks, in a progressive manor.</p>535<p>Alternatively we can <em>use()</em> them which is useful when adding middleware within <em>configure()</em> blocks, in a progressive manner.</p>536537<pre><code>app.use(express.logger({ format: ':method :url' }));538</code></pre>539
117 unmodified lines
657<p>There are times when we may want to &ldquo;skip&rdquo; passed remaining route middleware, but continue matching subsequent routes. To do this we invoke <code>next()</code> with the string &ldquo;route&rdquo; <code>next('route')</code>. If no remaining routes match the request url then Express will respond with 404 Not Found.</p>658659<h3 id="http-methods">HTTP Methods</h3>660661<p>We have seen <em>app.get()</em> a few times, however Express also exposes other familiar HTTP verbs in the same manor, such as <em>app.post()</em>, <em>app.del()</em>, etc.</p>661<p>We have seen <em>app.get()</em> a few times, however Express also exposes other familiar HTTP verbs in the same manner, such as <em>app.post()</em>, <em>app.del()</em>, etc.</p>662663<p> A common example for <em>POST</em> usage, is when &ldquo;submitting&rdquo; a form. Below we simply set our form method to &ldquo;post&rdquo; in our html, and control will be given to the route we have defined below it.</p>664665<pre><code> &lt;form method="post" action="/"&gt;
1137 unmodified lines
1803</code></pre>1804 </div>1805 </div>1806 </body>1807</html>1807</html>
modified:docs/guide.md+2 added-2 removed
260 unmodified lines
261 express.logger()262 , express.bodyParser()263 );264265Alternatively we can _use()_ them which is useful when adding middleware within _configure()_ blocks, in a progressive manor.265Alternatively we can _use()_ them which is useful when adding middleware within _configure()_ blocks, in a progressive manner.266267 app.use(express.logger({ format: ':method :url' }));268269Typically with connect middleware you would _require('connect')_ like so:
108 unmodified lines
378There are times when we may want to "skip" passed remaining route middleware, but continue matching subsequent routes. To do this we invoke `next()` with the string "route" `next('route')`. If no remaining routes match the request url then Express will respond with 404 Not Found.379380### HTTP Methods381382We have seen _app.get()_ a few times, however Express also exposes other familiar HTTP verbs in the same manor, such as _app.post()_, _app.del()_, etc.382We have seen _app.get()_ a few times, however Express also exposes other familiar HTTP verbs in the same manner, such as _app.post()_, _app.del()_, etc.383384 A common example for _POST_ usage, is when "submitting" a form. Below we simply set our form method to "post" in our html, and control will be given to the route we have defined below it.385 386 <form method="post" action="/">
967 unmodified lines