Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

expression setup documentation

  • Loading branch information...
commit 3504720d6545ac89e76f4526f8f99043a55edb43 1 parent 43088e2
@warmuuh authored
Showing with 29 additions and 1 deletion.
  1. +3 −1 yaap/README.md
  2. +26 −0 yaap/docs/express.md
View
4 yaap/README.md
@@ -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 = {
View
26 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.
Please sign in to comment.
Something went wrong with that request. Please try again.