-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f650678
commit 4116516
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters