Created
September 2, 2014 00:12
-
-
Save ccampo133/958c2cf84707bbb0ab01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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