Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

correct readme request handler section, see #9

  • Loading branch information...
commit 69375158ff03cc7e6edac15ce6b653840de258f7 1 parent 84a6e15
@carlos8f authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 README.md
View
9 README.md
@@ -43,7 +43,7 @@ Middleware version (compatible with [connect](http://www.senchalabs.org/connect/
```javascript
var connect = require('connect')
, app = connect()
- , buffet = require('buffet')() // root defaults to ./public
+ , buffet = require('buffet')({root: './public'}) // root defaults to ./public
app.use(buffet);
app.use(buffet.notFound);
@@ -68,8 +68,11 @@ buffet 0.4.0 listening on port 8080
var server = require('http').createServer();
var buffet = require('buffet')(); // root defaults to ./public
-server.on('request', buffet);
-server.on('request', buffet.notFound);
+server.on('request', function (req, res) {
+ buffet(req, res, function () {
+ buffet.notFound(req, res);
+ });
+});
server.listen(3000, function () {
console.log('test server running on port 3000');
Please sign in to comment.
Something went wrong with that request. Please try again.