I have a function to get data from an external API:
app.get("/getdata", (req, res) => {
request.get({
url: 'http://externalurl',
json: true
})
.pipe(res);
});
It just shows the received JSON object in a browser. The question is, how could I render this data in a template like it's usually done with express methods like res.render("template", {data:data}) so that I could format it?