Advertisement
Guest User

Untitled

a guest
Jul 25th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. РАБОТАЕТ
  2. app.use(async (req, res, next) => {
  3.   res.locals.boards = await Board.find();
  4.   next();
  5. });
  6.  
  7.  
  8. НЕ РАБОТАЕТ
  9. app.use((req, res, next) => {
  10.   Board.find()
  11.     .then(result => {
  12.       res.locals.boards = result;
  13.     })
  14.     .catch(err => console.log(err));
  15.   next();
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement