Why are flashes always arrays?
samholmes opened this issue · 1 comments
samholmes commented
Why is it that in order to access:
req.flash('message', 'You forgot to enter something');
I have to do:
req.flash('message')[0];
instead of:
req.flash('message');
?
jaredhanson commented
That's the API.
This was extracted from Express 2.x, for compatibility after it was removed from Express 3.x. There original code is here: https://github.com/visionmedia/express/blob/2.5.11/lib/request.js#L189
This module behaves identically.