Created
April 14, 2016 16:12
-
-
Save beanmoss/12980dacf27dc209a0724d4d2a288757 to your computer and use it in GitHub Desktop.
Dropbox read file and serve it to the browser.
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 Dropbox = require("dropbox"); | |
var fs = require("fs"); | |
var config = require('../config'); | |
var client = new Dropbox.Client(config.dropbox); | |
getFile: function (file, res) { | |
client.readFile(file,{ buffer: true }, function (error, result) { | |
if (error) { | |
console.log(error); | |
} | |
console.log(result); | |
res.end(result); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment