Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
particlebanana committed Aug 24, 2012
1 parent f650678 commit 4116516
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
66 changes: 65 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,68 @@
Recess
=======

A framework for building [Card-Catalog](https://github.com/TxSSC/Card-Catalog) based apps on.
A framework for building [Card-Catalog](https://github.com/TxSSC/Card-Catalog) based apps on. Inspired by [Express](https://github.com/visionmedia/express) and [Union](https://github.com/flatiron/union).

```js
var recess = require('recess'),
manager = require('catalog_manager');

var app = recess();

app.set('connection', conn);
app.card(manager);

app.on('ready', function() {
app.listen(3000);
});

app.create();
```

## Install

```bash
$ npm install recess
```

## Usage

Recess is simply a helper for building an application on top of [Card-Catalog](https://github.com/TxSSC/Card-Catalog). It provides a clean interface to setting up categories and cards as well as some helpers attached to the request and response object.

Available helper methods on a recess object are:

**set:** options for instantiating a Category

```js
app.set('setting', 'value');
```

**before:** middleware function to run before dispatching to a Category instance.

```js
app.before(function(req, res, next) {});
```

**card:** a Card to use in your Card-Catalog app.

```js
app.card(Manager);
```

**create:** initialize a catalog by loading all the available cards and setting up a template cache. Emits a `ready` event when the catalog has been built.

**listen:** create an http server and listen on a given port.

```js
app.listen(process.env.PORT);
```

**For more information view the documentation on the [Card-Catalog](https://github.com/TxSSC/Card-Catalog) project**

## Tests

All tests are written in [mocha](https://github.com/visionmedia/mocha) and should be run with npm.

```bash
$ npm test
```
3 changes: 3 additions & 0 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ app.handle = function(req, res) {

/**
* Create Catalog
*
* Creates a catalog and loads templates into cache.
* Emits a `ready` event when completed.
*/
app.create = function create() {
var self = this;
Expand Down

0 comments on commit 4116516

Please sign in to comment.