Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6 from mrienstra/patch-1

Fixed the "HTTP application" code sample for Director
  • Loading branch information...
commit d778b152d25a49d68802845188f583fd539f2684 2 parents 1513274 + 5dcd22c
@pksunkara pksunkara authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 public/index.html
View
6 public/index.html
@@ -212,7 +212,7 @@ <h2 class="green">URL Routing with <span class="name">Director</span></h2>
<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 @@ <h2 class="green">URL Routing with <span class="name">Director</span></h2>
// 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>
Please sign in to comment.
Something went wrong with that request. Please try again.