Permalink
Browse files

bodyParser

  • Loading branch information...
1 parent 021fc3e commit 732831b1ab130dcade30cdc2257039fa2b4d8961 @tj tj committed Oct 13, 2012
Showing with 19 additions and 3 deletions.
  1. +3 −3 en/api/mw-basicAuth.jade
  2. +16 −0 en/api/mw-bodyParser.jade
View
@@ -2,7 +2,7 @@ section
h3(id='basicAuth') basicAuth()
p.
- Basic Authentication middleware, populating `req.user`
+ Basic Authentication middleware, populating <code>req.user</code>
with the username.
p Simple username and password:
@@ -18,8 +18,8 @@ section
}));
p.
- Async callback verification, accepting `fn(err, user)`,
- in this case `req.user` will be the `user` object passed.
+ Async callback verification, accepting <code>fn(err, user)</code>,
+ in this case <code>req.user</code> will be the user object passed.
+js.
app.use(connect.basicAuth(function(user, pass, fn){
View
@@ -0,0 +1,16 @@
+section
+ h3(id='bodyParser') bodyParser()
+
+ p.
+ Request body parsing middleware supporting JSON, urlencoded,
+ and multipart requests. This middleware is simply a wrapper
+ the <code>json()</code>, <code>urlencoded()</code>, and
+ <code>multipart()</code> middleware.
+
+ +js.
+ app.use(express.bodyParser());
+
+ // is equivalent to:
+ app.use(express.json());
+ app.use(express.urlencoded());
+ app.use(express.multipart());

0 comments on commit 732831b

Please sign in to comment.