rendering results of multiple DB/mongoose queries to a view in express.js

后端 未结 3 1225
无人及你
无人及你 2020-12-30 16:26

given the async nature of mongoose (or sequelize, or redis) queries, what do you do when you have multiple queries you need to make before rendering the view?

For in

3条回答
  •  借酒劲吻你
    2020-12-30 16:37

    Nowadays you can use app.param in ExpressJS to easily establish middleware that loads needed data based on the name of parameters in the request URL.

    http://expressjs.com/4x/api.html#app.param

提交回复
热议问题