Skip to content

Instantly share code, notes, and snippets.

@ccampo133
Created September 2, 2014 00:12
Show Gist options
  • Save ccampo133/958c2cf84707bbb0ab01 to your computer and use it in GitHub Desktop.
Save ccampo133/958c2cf84707bbb0ab01 to your computer and use it in GitHub Desktop.
var restify = require('restify');
var server = restify.createServer({ name: 'example' });
var fs = require('fs');
server.listen(8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
server.use(restify.fullResponse()).use(restify.bodyParser());
server.post('/api/signature', function (req, res, next) {
fs.writeFileSync("img.png", new Buffer(req.body, 'base64'));
res.send(200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment