This file contains hidden or 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
| upstream api { | |
| server 127.0.0.1:3000; | |
| keepalive 10; | |
| } | |
| server { | |
| listen 80; | |
| server_name yourdomain.com www.yourdomain.com; | |
| # | |
| # You can ignore the majority of these next lines, |
This file contains hidden or 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
| // PhantomJS Render to base64 function | |
| page.renderBase64('png', function(err, img) { | |
| var image = {}; | |
| image.thumb = []; | |
| final.full = new Buffer(img, 'base64'); // Convert the base64 encoded value into binary. | |
| var thumbStream = new stream.Stream(); // Create a new writable stream | |
| thumbStream.writable = true; | |
| thumbStream.write = function (chunk) { | |
| image.thumb.push(chunk); // Take the data written and store it into an array |
This file contains hidden or 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
| app.get('/list/:bucket', function (req,res){ | |
| var keys = []; | |
| res.setHeader('Content-Type', 'application/json'); | |
| db.keys(req.params.bucket, {keys: 'stream', props: false}) | |
| .on('keys', | |
| function(data) { | |
| console.log(data); | |
| data.forEach(function(key) { | |
| keys.push(key); | |
| }); |
NewerOlder