var base64Data = req.body.image.replace(/^data:image/png;base64,/, "");
require("fs").writeFile("out.png", base64Data, 'base64', function(err) {
console.log(err);
});
var imageBuffer = request.file.buffer;
var imageName = 'public/images/map.png';
fs.createWriteStream(imageName).write(imageBuffer);