Express.js application bug: validationResult(req) method does not work

后端 未结 8 2161
轻奢々
轻奢々 2020-12-22 02:38

I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB.

Before submitting a

8条回答
  •  滥情空心
    2020-12-22 03:23

    use this code in index.js to get flash error messages locally in EJS ,

    app.use(function (req, res, next) {
        res.locals.messages = req.flash();
        next();
    });
    

提交回复
热议问题