I'm still kinda confused on what exactly is the difference between flash, connect-flash and express-flash.
Installation:
flash
npm install flash
express-flash :
npm install express-flash
connect-flash :
npm install connect-flash
Usage:
flash:
app.use(session()); // session middleware
app.use(require('flash')());
app.use(function (req, res) {
// flash a message
req.flash('info', 'hello!');
next();
})
connect-flash
var flash = require('connect-flash');
var app = express();
app.configure(function() {
app.use(express.cookieParser('keyboard cat'));
app.use(express.session({ cookie: { maxAge: 60000 }}));
app.use(flash());
});
express-flash It even request that the usage should set up the same way you would connect-flash:
var flash = require('express-flash'),
express = require('express'),
app = express();
app.use(express.cookieParser('keyboard cat'));
app.use(express.session({ cookie: { maxAge: 60000 }}));
app.use(flash());
Can someone please explain?
connect-flash
hasn't been updated since 2013 except for an advertisement added to the README. – Elfredaelfrida