Skip to content

Instantly share code, notes, and snippets.

@kgn
Created September 21, 2021 14:33
Show Gist options
  • Save kgn/a9d6afe17a9ddde2f17f0498e6b30084 to your computer and use it in GitHub Desktop.
Save kgn/a9d6afe17a9ddde2f17f0498e6b30084 to your computer and use it in GitHub Desktop.
const svg2img = require('svg2img');
module.exports = (req, res) => {
svg2img(req.query.url, {width: req.query.width, height: req.query.height, preserveAspectRatio: true},
function(error, buffer) {
if (buffer) {
res.send(buffer);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment