Skip to content
Myr

Migration docs for req.param()

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 74432a6 · Browse files · 3 files+31 added−3 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+31 added−3 removed

  • other:+31 added−3 removed

3 files+31 added−3 removed

modified:docs/migrate.1+16 added-1 removed
148 unmodified lines
149.150.IP "" 0151.152.P153Now they (\fIroute params only\fR) are passed as the third argument:153Polymorphic parameter access can be done using \fBreq\.param()\fR:154.155.IP "" 4156.157.nf158159app\.get(\'/user/:id\', function(){160 req\.param(\'id\');161});162.163.fi164.165.IP "" 0166.167.P168Route parameters are also passed as the third argument:169.170.IP "" 4171.172.nf173174app\.get(\'/user/:id\', function(req, res, params){175 params\.id;176});177.
153 unmodified lines
modified:docs/migrate.html+8 added-1 removed
247 unmodified lines
248 this.param('id');249});250</code></pre>251252<p>Now they (<em>route params only</em>) are passed as the third argument:</p>252<p>Polymorphic parameter access can be done using <code>req.param()</code>:</p>253254<pre><code>app.get('/user/:id', function(){255 req.param('id');256});257</code></pre>258259<p>Route parameters are also passed as the third argument:</p>260261<pre><code>app.get('/user/:id', function(req, res, params){262 params.id;263});264</code></pre>
91 unmodified lines
modified:docs/migrate.md+7 added-1 removed