Created
June 2, 2014 01:16
-
-
Save max-mapper/599adc55e79ce32bb8dd to your computer and use it in GitHub Desktop.
dat w/ google drive blob storage
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
var path = require('path') | |
var fs = require('fs') | |
var Dat = require('dat') | |
var gdb = require('google-drive-blobs') | |
var tokens = JSON.parse(fs.readFileSync(path.join(process.env.HOME, '.config', 'googleauth.json'))) | |
tokens.client_id = process.env['GOOGLE_CLIENT'] | |
tokens.client_secret = process.env['GOOGLE_SECRET'] | |
var blobs = gdb(tokens) | |
var dat = Dat('./', {blobs: function(path, hasher) { return blobs }}, function(err) { | |
if (err) throw err | |
dat.listen(6461, function(err) { | |
if (err) throw err | |
console.log('listening on 6461') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment