Skip to content
Myr

Migration docs for params

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 9e68a5b · Browse files · 3 files+63 added−0 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+63 added−0 removed

  • other:+63 added−0 removed

3 files+63 added−0 removed

modified:docs/migrate.1+30 added
73 unmodified lines
74.75.fi76.77.IP "" 078.79.SS "Route Parameters"80Previously we could use \fBthis\.param()\fR to attempt fetching a route, query string, or request body parameter:81.82.IP "" 483.84.nf8586get(\'/user/:id\', function(){87 this\.param(\'id\');88});89.90.fi91.92.IP "" 093.94.P95Now they (\fIroute params only\fR) are passed as the third argument:96.97.IP "" 498.99.nf100101app\.get(\'/user/:id\', function(req, res, params){102 params\.id;103});104.105.fi106.107.IP "" 0108
modified:docs/migrate.html+17 added
201 unmodified lines
202<pre><code>app.listen();203app.listen(3000);204</code></pre>205206<h3 id="Route-Parameters">Route Parameters</h3>207208<p>Previously we could use <code>this.param()</code> to attempt209fetching a route, query string, or request body parameter:</p>210211<pre><code>get('/user/:id', function(){212 this.param('id');213});214</code></pre>215216<p>Now they (<em>route params only</em>) are passed as the third argument:</p>217218<pre><code>app.get('/user/:id', function(req, res, params){219 params.id;220});221</code></pre>222223</div>224 </div>225 </div>226 </body>
1 unmodified line
modified:docs/migrate.md+16 added