Node.js 's post request rendering template engine problem

Why does the post request in node.js output the source code directly in the console instead of displaying it on the page in the form of a web page when the render rendering template engine is used, and res.send () is also output in the console? thank you.

router.post("/user",function(req,res){
  var idCard=req.body.idCards
  var admTicket=req.body.admTickets;
  var resdata={};
  db.query("SELECT `admTicket` FROM `student` WHERE `idCard`=""+idCard+"";",function(err,data){
      if(err)
      {
          resdata.type="fail";
          resdata.message="";
      }
      else
      {
          if(data.length==0)
          {
              resdata.type="fail";
              resdata.message="";
          }
          else
          {
              if(data[0].admTicket==admTicket)
              {
                  resdata.type="success";
                  resdata.message="";
                  res.type("html");
                  res.render("test111");
              }
              else
              {
                  resdata.type="fail";
                  resdata.message="";
                  console.log("no");
              }
          }
      }
      res.send(resdata);
  });
});

the following is the effect:

Mar.18,2021

you need to set the Content-Type in header to text/html so that the browser knows it is a html file and renders it, otherwise it will be displayed directly as normal data.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ffe-2c0d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ffe-2c0d5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?