Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjaure committed Aug 26, 2012
1 parent c2f46eb commit ed23f54
Showing 1 changed file with 41 additions and 10 deletions.
51 changes: 41 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,75 @@

Scrape your express app to generate static files.


## Getting Started
Once this is published: install the module with: `npm install freezeray`

Install the module with: `npm install freezeray`

```javascript
var freezeray = require('freezeray'),
app = require('./app');
freezeray(app, {
// options
});
app = require('./app'),
options = {},
cb = function(err) {};

freezeray(app, options, cb);
```
`app` is expected to be an Express app. It should not start the server.

- `app` is expected to be an Express app. It should not start the server.
- `options` are listed below.
- `cb` will be called when complete or if an error is encountered.


## Options

### publishDir
### `publishDir` (default: `'./publish'`)
Where do you want the static files to end up? Any existing files will be deleted.

### publicDir
### `publicDir` (default: `'./public'`)
Directory containing assets that should be copied to `publishDir`.

### serverConfig
### `serverConfig` (default: `{ hostname: 'localhost', port: '3456'}`)
An object containing `hostname` and `port`.

### `verbose` (default: `false`)
Log what's happening.

## Examples
Sample usage:

```javascript
process.env.NODE_ENV = 'staging';

var freezeray = require('freezeray'),
app = require('./app');
express = require('express'),
app = express();

app.use(app.router);

app.get('/', function(req, res) {
res.end('Test');
});

freezeray(app, {
publishDir: __dirname + '/publish',
publicDir: __dirname + '/public'
}, function(err) {
if (err) {
console.error(err);
}
else {
console.log('Done!');
}
});
```


## Tests

Install devDependencies and run `npm test`.


## License

Copyright (c) 2012 Chris Jaure
Licensed under the MIT license.

0 comments on commit ed23f54

Please sign in to comment.