Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
  });
});
 
PREVIOUS NEXT
Tagged: #render #XML #node
ADD COMMENT
Topic
Name
2+7 =