Nodejs exprss framework jade

  node.js, question

Let’s ask a basic question.

I am currently using node’s express framework to build projects and using jade templates. However, I am not very likely to show jade how to send parameters in express. How to get them in jade. This problem, which may be relatively new, will be pointed out by everyone.

Recently, I have been doing this too. For the time being, I know two methods:

  1. Set up local variables,app.locals.user = {name: "11"}

  2. res.render('index', {
     user: {
     name: "11"
     bracket
     })

index.jade

if user.name
 div #{user.name}