Skip to content
Myr

deps: update example dependencies

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent ffe663a · Browse files · 12 files+21 added−35 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

12 files+21 added−35 removed

  • tests:+7 added−1 removed
  • other:+14 added−34 removed

12 files+21 added−35 removed

modified:examples/auth/app.js+2 added-4 removed
modified:examples/cookie-sessions/index.js+1 added-5 removed
modified:examples/cookies/app.js+2 added-2 removed
15 unmodified lines
16// when the secret is passed, used17// for signing the cookies.18app.use(cookieParser('my secret here'));1920// parses json, x-www-form-urlencoded, and multipart/form-data21app.use(bodyParser());20// parses x-www-form-urlencoded21app.use(bodyParser.urlencoded({ extended: false }));2223app.get('/', function(req, res){24 if (req.cookies.remember) {25 res.send('Remembered :). Click to <a href="/forget">forget</a>!.');
23 unmodified lines
modified:examples/cors/index.js+1 added-1 removed
13 unmodified lines
1415// api middleware1617api.use(logger('dev'));18api.use(bodyParser());18api.use(bodyParser.json());1920/**21 * CORS support.22 */
26 unmodified lines
modified:examples/mvc/index.js+2 added-4 removed
3 unmodified lines
45var express = require('../..');6var logger = require('morgan');7var session = require('express-session');8var cookieParser = require('cookie-parser');8var bodyParser = require('body-parser');9var methodOverride = require('method-override');1011var app = module.exports = express();
24 unmodified lines
36// serve static files37app.use(express.static(__dirname + '/public'));3839// session support41app.use(cookieParser('some secret here'));42app.use(session());40app.use(session({ secret: 'some secret here' }));4142// parse request bodies (req.body)45app.use(bodyParser());43app.use(bodyParser.urlencoded({ extended: true }));4445// allow overriding methods in query (?_method=put)46app.use(methodOverride('_method'));47
44 unmodified lines
modified:examples/route-separation/index.js+1 added-1 removed
16 unmodified lines
17app.set('views', __dirname + '/views');18app.use(logger('dev'));19app.use(methodOverride('_method'));20app.use(cookieParser());21app.use(bodyParser());21app.use(bodyParser.urlencoded({ extended: true }));22app.use(express.static(__dirname + '/public'));2324// General25
20 unmodified lines
modified:examples/session/index.js+1 added-7 removed
modified:examples/session/redis.js+1 added-7 removed
2 unmodified lines
3 */45var express = require('../..');6var logger = require('morgan');7var cookieParser = require('cookie-parser');7var session = require('express-session');89// pass the express to the connect redis module10// allowing it to inherit from session.Store
2 unmodified lines
13var app = express();1415app.use(logger('dev'));1618// Required by session() middleware19// pass the secret for signed cookies20// (required by session())21app.use(cookieParser('keyboard cat'));2217// Populates req.session24app.use(session({ store: new RedisStore }));18app.use(session({ store: new RedisStore, secret: 'keyboard cat' }));1920app.get('/', function(req, res){21 var body = '';22 if (req.session.views) {
10 unmodified lines
modified:test/acceptance/cookies.js+3 added
20 unmodified lines
2122 it('should respond to cookie', function(done){23 request(app)24 .post('/')25 .type('urlencoded')26 .send({ remember: 1 })27 .expect(302, function(err, res){28 if (err) return done(err)29 request(app)
7 unmodified lines
37 describe('GET /forget', function(){38 it('should clear cookie', function(done){39 request(app)40 .post('/')41 .type('urlencoded')42 .send({ remember: 1 })43 .expect(302, function(err, res){44 if (err) return done(err)45 request(app)
8 unmodified lines
54 describe('POST /', function(){55 it('should set a cookie', function(done){56 request(app)57 .post('/')58 .type('urlencoded')59 .send({ remember: 1 })60 .expect(302, function(err, res){61 res.headers.should.have.property('set-cookie')62 done()
14 unmodified lines
modified:test/acceptance/mvc.js+3 added
31 unmodified lines
32 describe('PUT /pet/2', function(){33 it('should update the pet', function(done){34 request(app)35 .put('/pet/3')36 .set('Content-Type', 'application/x-www-form-urlencoded')37 .send({ pet: { name: 'Boots' } })38 .end(function(err, res){39 if (err) return done(err);40 request(app)
61 unmodified lines
102103 it('should update the user', function(done){104 request(app)105 .put('/user/1')106 .set('Content-Type', 'application/x-www-form-urlencoded')107 .send({ user: { name: 'Tobo' }})108 .end(function(err, res){109 if (err) return done(err);110 request(app)
6 unmodified lines
117 describe('POST /user/:id/pet', function(){118 it('should create a pet for user', function(done){119 request(app)120 .post('/user/2/pet')121 .set('Content-Type', 'application/x-www-form-urlencoded')122 .send({ pet: { name: 'Snickers' }})123 .expect('Location', '/user/2')124 .expect(302, function(err, res){125 if (err) return done(err)
7 unmodified lines
modified:test/req.param.js+1 added-1 removed
32 unmodified lines
3334 it('should check req.body', function(done){35 var app = express();3637 app.use(bodyParser());37 app.use(bodyParser.json());3839 app.use(function(req, res){40 res.end(req.param('name'));41 });
20 unmodified lines
modified:package.json+3 added-3 removed
55 unmodified lines
56 "jade": "~1.3.1",57 "marked": "0.3.2",58 "multiparty": "~3.2.4",59 "hjs": "~0.0.6",60 "body-parser": "1.3.0",61 "cookie-parser": "1.1.0",62 "express-session": "1.2.1",60 "body-parser": "~1.4.3",61 "cookie-parser": "~1.3.1",62 "express-session": "~1.5.0",63 "method-override": "2.0.2",64 "morgan": "1.1.1",65 "vhost": "2.0.0"66 },
10 unmodified lines