Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / cookie-parser / cookie-parser.js
301 bytesRaw
1 | ; |
2 | |
3 | var cookieParser = require('cookie-parser'); |
4 | var req = { headers: { cookie: 'MyCookie=Hello' } }; |
5 | var res = {}; |
6 | |
7 | var middleware = cookieParser(); |
8 | |
9 | middleware(req, res, function () { |
10 | if (req.cookies) { |
11 | if (req.cookies.MyCookie === 'Hello') { |
12 | console.log('ok'); |
13 | } |
14 | } |
15 | }); |
16 |
Built with git-ssb-web