Categories
JavaScript Answers

How to send flash messages in Node Express 4.0?

Spread the love

To send flash messages in Node Express 4.0, we use the flash package.

To add it, we write

app.use(flash());

Then we send a flash message in our middleware with

req.flash("signupMessage", anyValue);

The first argument is the key and the 2nd is the value.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *