Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #6 from mrienstra/patch-1
Browse files Browse the repository at this point in the history
Fixed the "HTTP application" code sample for Director
  • Loading branch information
pksunkara committed Feb 18, 2012
2 parents 1513274 + 5dcd22c commit d778b15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/index.html
Expand Up @@ -212,7 +212,7 @@ <h4>HTTP application</h4>
<div class="panel"> <div class="panel">
<pre class="syntax"> <pre class="syntax">
var flatiron = require('flatiron'), var flatiron = require('flatiron'),
app = flatiron.app; app = flatiron.app;


app.use(flatiron.plugins.http, { app.use(flatiron.plugins.http, {
// HTTP options // HTTP options
Expand All @@ -222,10 +222,12 @@ <h4>HTTP application</h4>
// app.router is now available. app[HTTP-VERB] is also available // app.router is now available. app[HTTP-VERB] is also available
// as a shortcut for creating routes // 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.writeHead(200, { 'Content-Type': 'text/plain' })
this.res.end('flatiron ' + flatiron.version); this.res.end('flatiron ' + flatiron.version);
}); });

app.start(8080);
</pre> </pre>
</div> </div>


Expand Down

0 comments on commit d778b15

Please sign in to comment.