DEV Community

loading...

Discussion on: Has anyone created a Node.js app that renders HTML instead of JSON?

Collapse
jrop profile image
Jonathan Apodaca • Edited

I second pug/jade.

Note that for simple use cases, one can do things like:

app.get('/', (req, res) => res.set('content-type', 'text/html').end(`
  <h1>It works!</h1>
  <p>You can send your HTML string in via ES6 template strings!</p>
  <p>Node version: ${process.versions.node}</p>
`))
Forem Open with the Forem app