Render HTML string in Node?

后端 未结 1 1697
遥遥无期
遥遥无期 2021-02-19 05:31

Alright, so I have downloaded Express, set the port with process.env.PORT || 8080, and set the app variable var app = express(). Now, what I\'m trying

相关标签:
1条回答
  • 2021-02-19 06:18

    the res.render method as specified in the doc : Renders a view and sends the rendered HTML string to the client. So you need to use a template engine eg : jade,ejs, handlebars.. but if your purpose is to only output some html you can do it with res.send instead.

    0 讨论(0)
提交回复
热议问题