Polka: is there any res.locals equivalent?

Created on 10 Jan 2019  路  1Comment  路  Source: lukeed/polka

Most helpful comment

There isn't & I haven't decided if there should need to be in 1.0...

This is because res.locals is just an object. It only has special meaning in the context of view/template rendering. Polka won't have template rendering (by default) so I'm not sure how this should play out.

polka()
  .use((req, res, next) => {
    res.locals = {}
    next();
  })

>All comments

There isn't & I haven't decided if there should need to be in 1.0...

This is because res.locals is just an object. It only has special meaning in the context of view/template rendering. Polka won't have template rendering (by default) so I'm not sure how this should play out.

polka()
  .use((req, res, next) => {
    res.locals = {}
    next();
  })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ansarizafar picture ansarizafar  路  3Comments

orefalo picture orefalo  路  6Comments

galuh1300d picture galuh1300d  路  4Comments

lukeed picture lukeed  路  10Comments

itaditya picture itaditya  路  3Comments