What I'm trying to do is create a small API to generate jdenticons and deliver them as pngs. They shouldn't be stored on the server. My code
app.get("/api/avatar/:name", (req, res) => { let img=jdenticon.toPng(req.params.name, (isset(req.query.size)?req.query.size:64)); res.sendFile(img); });
gives an error because img isn't a path. So how do I convert the Jdenticon to a file and send it?
2.1m questions
2.1m answers
60 comments
57.0k users