Skip to content

Commit

Permalink
expression setup documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
warmuuh committed Apr 5, 2013
1 parent 43088e2 commit 3504720
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yaap/README.md
Expand Up @@ -120,7 +120,9 @@ The yaap/wire plugin will be called after the bean was created. That means, the
As a workaround, use a separate initialize-method (using the [init-facade](https://github.com/cujojs/wire/blob/master/docs/configure.md#init-methods) of wire).

##Express.js integration
There are also out-of-the-box annotations included for creating webapps in a springMVC-like manner. A simple example of a service:
There are also out-of-the-box annotations included for creating webapps in a springMVC-like manner.
More information on how to setup this integration is available [here](docs/express.md)
A simple example of a service:

```js
MyService.prototype = {
Expand Down
26 changes: 26 additions & 0 deletions yaap/docs/express.md
@@ -0,0 +1,26 @@
#Express.js integration
If you want to use the `yaap/wire/express` plugin, you need to supply an express application to the plugin. This is done during wire-setup as follows:
Your wire-context:
```js
{
app: { create: 'express',
init:{use:[express.bodyParser()]},
ready:{listen:[8000]}
},
myService: { create: './MyService' },

plugins: [
{module: "yaap/wire"},
{module: "yaap/wire/express",server: "app"}
]
}

```

The setup of the application is exemplary and can also be done somewhere else.
The yaap/wire/express accepts the name of a reference which will later be resolved against the wire-context as `server`-parameter.

##yaap/wire/express options
There are several options that can be configured during plugin-setup.
*`server` (mandatory): string name of the express-application bean
*`view` (optional, default: "jade"): string of the extension that will be added to view-names. These extensions determine the template-engine in express.

0 comments on commit 3504720

Please sign in to comment.