Skip to content

Commit 6f1b573

Browse files
committed
Merge pull request meteorhacks#20 from themeteorchef/update_readme_#19
Update readme to reflect latest body-parser API
2 parents 5f0bed9 + 2e25114 commit 6f1b573

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ You can create any amount of sub routes with this `filter` API. Same time, you c
5353
You can use existing `connect` and `express` middlewares without any issues.
5454

5555
~~~js
56-
var bodyParser = Meteor.npmRequire('body-parser'); // using meteorhacks:npm package
57-
Picker.middleware(bodyParser());
56+
// You can use the meteorhacks:npm package to load in the body-parser package
57+
// via NPM.
58+
var bodyParser = Meteor.npmRequire( 'body-parser');
59+
60+
// Add two middleware calls. The first attempting to parse the request body as
61+
// JSON data and the second as URL encoded data.
62+
Picker.middleware( bodyParser.json() );
63+
Picker.middleware( bodyParser.urlencoded( { extended: false } ) );
5864
~~~
5965

6066
You can use middlewares on sub routes as well.

0 commit comments

Comments
 (0)