Skip to content

Commit

Permalink
Merge pull request #3 from Zearin/patch-1
Browse files Browse the repository at this point in the history
Added syntax highlighting.
  • Loading branch information
tj committed Jun 17, 2011
2 parents 76134b4 + 082b419 commit 963e8d4
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions Readme.md
@@ -1,4 +1,3 @@

# Express Contrib
Adds async configuration support to Express.
Expand All @@ -7,30 +6,38 @@

npm:

$ npm install express-configure
```bash
$ npm install express-configure
```

## Usage

Ever wanted to boot your Express app settings using Redis or a similar key/value store before accepting connections? well now it is easy, all we need to do is `require('express-configure')` which monkey-patches express, and then invoke the optional callback `configure()`.

app.configure(function(done){
redis.hgetall('settings', function(err, obj){
for (var key in obj) app.set(key, obj[key]);
done();
});
});
```javascript
app.configure(function(done){
redis.hgetall('settings', function(err, obj){
for (var key in obj) app.set(key, obj[key]);
done();
});
});

app.listen(3000);
app.listen(3000);
```

## Running Tests

First make sure you have the submodules:

$ git submodule update --init
```bash
$ git submodule update --init
```

Then run the tests:

$ make test
```bash
$ make test
```

## License

Expand Down

0 comments on commit 963e8d4

Please sign in to comment.