Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
noosxe committed Nov 5, 2015
1 parent 8498a4b commit 04ba3a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ The following configuration properties are optional
In case you need some middleware to be added to express' middleware chain use ``` .addMiddlewareSetupAction() ``` method on ``` HuglaHttp ``` class instance, providing a function that needs to be called during middleware setup process. That method will called with express app argument, that you can use to attach your middleware.
``` .addMiddlewareSetupAction() ``` method needs to be called before ``` .setup() ``` is called for ``` HuglaHttp ``` class instance, as middleware setup process happens during ``` .setup() ``` method execution.

Middleware setup action will also receive node's http server as second argument.

## Example

```javascript
Expand All @@ -49,7 +51,7 @@ const bodyParser = require('body-parser');

...

huglaHttp.addMiddlewareSetupAction(function(app) {
huglaHttp.addMiddlewareSetupAction(function(app, http) {
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
});
Expand Down

0 comments on commit 04ba3a5

Please sign in to comment.