Skip to content
Myr

Removed backticks from 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 927aae7 · Browse files · 3 files+39 added−39 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+39 added−39 removed

  • other:+39 added−39 removed

3 files+39 added−39 removed

modified:docs/migrate.1+11 added-11 removed
2 unmodified lines
3.4.TH "MIGRATE" "" "July 2010" "" ""5.6.SH "Migration Guide"7Express 1\.x is written to run on\-top of the Connect \fIhttp://extjs\.github\.com/Connect\fR middlware framework, thus the \fBPlugin\fR has been replaced by Connect\'s middleware\.7Express 1\.x is written to run on\-top of the Connect \fIhttp://extjs\.github\.com/Connect\fR middlware framework, thus the \fIPlugin\fR has been replaced by Connect\'s middleware\.8.9.SS "Creating Applications"10Previously due to legacy code implemented in the early days of node, Express unfortunately had some globals\. The DSL would previously be accessed as shown below:11.
15 unmodified lines
27.28.IP "" 029.30.P31Now we utilize the CommonJS module system appropriately, and introduce \fBexpress\.createServer()\fR which accepts the same arguments as \fBhttp\.createServer()\fR:31Now we utilize the CommonJS module system appropriately, and introduce \fIexpress\.createServer()\fR which accepts the same arguments as \fIhttp\.createServer()\fR:32.33.IP "" 434.35.nf
31 unmodified lines
67.68.IP "" 069.70.P71Which we can now \fBuse()\fR within our app, or pass to the \fBexpress\.createServer()\fR method:71Which we can now \fIuse()\fR within our app, or pass to the \fIexpress\.createServer()\fR method:72.73.IP "" 474.75.nf
31 unmodified lines
107.P108For documentation on creating Connect middleware visit Middleware Authoring \fIhttp://extjs\.github\.com/Connect/#Middleware\-Authoring\fR\.109.110.SS "Running Applications"111Previously a global function \fBrun()\fR, was available:111Previously a global function \fIrun()\fR, was available:112.113.IP "" 4114.115.nf
4 unmodified lines
120.121.IP "" 0122.123.P124The new \fBexpress\.Server\fR has the same API as \fBhttp\.Server\fR, so we can do things like:124The new \fIexpress\.Server\fR has the same API as \fIhttp\.Server\fR, so we can do things like:125.126.IP "" 4127.128.nf
5 unmodified lines
134.135.IP "" 0136.137.SS "Route Parameters"138Previously we could use \fBthis\.param()\fR to attempt fetching a route, query string, or request body parameter:138Previously we could use \fIthis\.param()\fR to attempt fetching a route, query string, or request body parameter:139.140.IP "" 4141.142.nf
36 unmodified lines
179.180.IP "" 0181.182.P183Now Express has access to Connect\'s \fBnext()\fR function, which is passed as the fourth and final argument\. Calling \fBnext()\fR will pass control to the next \fImatching route\fR, or continue down the stack of Connect middleware\.183Now Express has access to Connect\'s \fInext()\fR function, which is passed as the fourth and final argument\. Calling \fInext()\fR will pass control to the next \fImatching route\fR, or continue down the stack of Connect middleware\.184.185.IP "" 4186.187.nf
10 unmodified lines
198.199.IP "" 0200.201.SS "View Rendering"202View filenames no longer take the form \fINAME\fR\.\fITYPE\fR\.\fIENGINE\fR, the \fIContent\-Type\fR can be set via \fBServerResponse#contentType()\fR or \fBServerResponse#header()\fR\. For example what was previously \fIlayout\.html\.haml\fR, should now be \fIlayout\.haml\fR\.202View filenames no longer take the form \fINAME\fR\.\fITYPE\fR\.\fIENGINE\fR, the \fIContent\-Type\fR can be set via \fIres\.contentType()\fR or \fIres\.header()\fR\. For example what was previously \fIlayout\.html\.haml\fR, should now be \fIlayout\.haml\fR\.203.204.P205Previously a view render looked something like this:206.
11 unmodified lines
218.219.IP "" 0220.221.P222We now have \fBServerResponse#render()\fR, however the options passed to haml \fIhttp://github\.com/visionmedia/haml\.js\fR, jade \fIhttp://github\.com/visionmedia/jade\fR, and others remain the same\.222We now have \fIres\.render()\fR, however the options passed to haml \fIhttp://github\.com/visionmedia/haml\.js\fR, jade \fIhttp://github\.com/visionmedia/jade\fR, and others remain the same\.223.224.IP "" 4225.226.nf
8 unmodified lines
235.236.IP "" 0237.238.P239Previously rendering of a collection via \fBpartial()\fR would look something like this:239Previously rendering of a collection via \fIpartial()\fR would look something like this:240.241.IP "" 4242.243.nf
4 unmodified lines
248.249.IP "" 0250.251.P252Although this worked just fine, it was generally to verbose, the similar but new API looks like this, as \fBpartial()\fR is \fIalways\fR passed as a local variable:252Although this worked just fine, it was generally to verbose, the similar but new API looks like this, as \fIpartial()\fR is \fIalways\fR passed as a local variable:253.254.IP "" 4255.256.nf
33 unmodified lines
modified:docs/migrate.html+14 added-14 removed
152 unmodified lines
153<div class='mp'>154<h2 id="Migration-Guide">Migration Guide</h2>155156<p>Express 1.x is written to run on-top of the <a href="http://extjs.github.com/Connect">Connect</a> middlware157framework, thus the <code>Plugin</code> has been replaced by Connect's middleware.</p>157framework, thus the <em>Plugin</em> has been replaced by Connect's middleware.</p>158159<h3 id="Creating-Applications">Creating Applications</h3>160161<p>Previously due to legacy code implemented in the early days of node,
11 unmodified lines
173});174</code></pre>175176<p>Now we utilize the CommonJS module system appropriately, and177introduce <code>express.createServer()</code> which accepts the same arguments178as <code>http.createServer()</code>:</p>177introduce <em>express.createServer()</em> which accepts the same arguments178as <em>http.createServer()</em>:</p>179180<pre><code>var express = require('express'),181 app = express.createServer();182
18 unmodified lines
201use(MethodOverride);202use(Cookie);203</code></pre>204205<p>Which we can now <code>use()</code> within our app, or pass to the <code>express.createServer()</code> method:</p>205<p>Which we can now <em>use()</em> within our app, or pass to the <em>express.createServer()</em> method:</p>206207<pre><code>var connect = require('connect');208209var app = express.createServer(
16 unmodified lines
226<p>For documentation on creating Connect middleware visit <a href="http://extjs.github.com/Connect/#Middleware-Authoring">Middleware Authoring</a>.</p>227228<h3 id="Running-Applications">Running Applications</h3>229230<p>Previously a global function <code>run()</code>, was available:</p>230<p>Previously a global function <em>run()</em>, was available:</p>231232<pre><code>run();233</code></pre>234235<p>The new <code>express.Server</code> has the same API as <code>http.Server</code>,235<p>The new <em>express.Server</em> has the same API as <em>http.Server</em>,236so we can do things like:</p>237238<pre><code>app.listen();239app.listen(3000);240</code></pre>241242<h3 id="Route-Parameters">Route Parameters</h3>243244<p>Previously we could use <code>this.param()</code> to attempt244<p>Previously we could use <em>this.param()</em> to attempt245fetching a route, query string, or request body parameter:</p>246247<pre><code>get('/user/:id', function(){248 this.param('id');
17 unmodified lines
266 this.pass('/foobar');267});268</code></pre>269270<p>Now Express has access to Connect's <code>next()</code> function,271which is passed as the fourth and final argument. Calling <code>next()</code> will270<p>Now Express has access to Connect's <em>next()</em> function,271which is passed as the fourth and final argument. Calling <em>next()</em> will272pass control to the next <em>matching route</em>, or continue down the stack273of Connect middleware.</p>274275<pre><code>app.get('/user/:id?', function(req, res, params, next){
7 unmodified lines
283284<h3 id="View-Rendering">View Rendering</h3>285286<p>View filenames no longer take the form <em>Express</em>.<em>TYPE</em>.<em>ENGINE</em>,287the <em>Content-Type</em> can be set via <code>ServerResponse#contentType()</code> or288<code>ServerResponse#header()</code>. For example what was previously <em>layout.html.haml</em>,287the <em>Content-Type</em> can be set via <em>res.contentType()</em> or288<em>res.header()</em>. For example what was previously <em>layout.html.haml</em>,289should now be <em>layout.haml</em>.</p>290291<p>Previously a view render looked something like this:</p>292
3 unmodified lines
296 });297});298</code></pre>299300<p>We now have <code>ServerResponse#render()</code>, however the options passed to <a href="http://github.com/visionmedia/haml.js">haml</a>, <a href="http://github.com/visionmedia/jade">jade</a>, and others300<p>We now have <em>res.render()</em>, however the options passed to <a href="http://github.com/visionmedia/haml.js">haml</a>, <a href="http://github.com/visionmedia/jade">jade</a>, and others301remain the same.</p>302303<pre><code>app.get('/', function(req, res){304 res.render('index.haml', {
1 unmodified line
306 });307});308</code></pre>309310<p>Previously rendering of a collection via <code>partial()</code> would look something like this:</p>310<p>Previously rendering of a collection via <em>partial()</em> would look something like this:</p>311312<pre><code>this.partial('comment.html.haml', { collection: comments });313</code></pre>314315<p>Although this worked just fine, it was generally to verbose, the similar but new API316looks like this, as <code>partial()</code> is <em>always</em> passed as a local variable:</p>316looks like this, as <em>partial()</em> is <em>always</em> passed as a local variable:</p>317318<pre><code>partial('comment.haml', { collection: comments });319</code></pre>320
16 unmodified lines
modified:docs/migrate.md+14 added-14 removed