Permalink
Browse files

Fixed the "HTTP application" code sample in the "URL Routing with Dir…

…ector" section.
  • Loading branch information...
mrienstra committed Feb 17, 2012
1 parent 1513274 commit 5dcd22c184d047fbda30318cd7e7db42842dff3d
Showing with 4 additions and 2 deletions.
  1. +4 −2 public/index.html
View
@@ -212,7 +212,7 @@ <h4>HTTP application</h4>
<div class="panel">
<pre class="syntax">
var flatiron = require('flatiron'),
- app = flatiron.app;
+ app = flatiron.app;
app.use(flatiron.plugins.http, {
// HTTP options
@@ -222,10 +222,12 @@ <h4>HTTP application</h4>
// app.router is now available. app[HTTP-VERB] is also available
// as a shortcut for creating routes
//
- app.get(/\/version/, function () {
+ app.router.get('/version', function () {
this.res.writeHead(200, { 'Content-Type': 'text/plain' })
this.res.end('flatiron ' + flatiron.version);
});
+
+ app.start(8080);
</pre>
</div>

0 comments on commit 5dcd22c

Please sign in to comment.