diff --git a/test/server.js b/test/server.js index 9f8f45c..8bd78d1 100644 --- a/test/server.js +++ b/test/server.js @@ -37,8 +37,13 @@ app.post('/render', function(req, res, next){ , canvas = new Canvas(width, height) , ctx = canvas.getContext('2d') , start = new Date; + fn(ctx); - res.send({ data: canvas.toDataURL(), duration: new Date - start }); + var duration = new Date - start; + + canvas.toDataURL(function(err, str){ + res.send({ data: str, duration: duration }); + }); }); app.listen(3000);