Answers for "render XML in node"

0

render XML in node

app.get('/sitemap.xml', function (req, res) {
  fs.readFile("./path/to/sitemap.xml", "utf-8", (err, data) => {
    if (err) {
      console.error(err);
      return
    }
    console.log(data);
    res.end(data) // Send Data
  });
});
Posted by: Guest on June-20-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language