Permalink
Browse files
add missing code to make the daemon work
- Loading branch information...
Showing
with
10 additions
and
1 deletion.
-
+10
−1
server.js
|
|
@@ -3,8 +3,17 @@ var dat = require('.')() |
|
|
module.exports = function (server, stream) {
|
|
|
return {
|
|
|
join: function (id, cb) {
|
|
|
var archive = dat.drive.get(id, '.')
|
|
|
dat.join(id)
|
|
|
console.log('join', id)
|
|
|
var stream = archive.createEntryStream()
|
|
|
stream.resume()
|
|
|
stream.on('data', function (data) {
|
|
|
console.log('got item', data)
|
|
|
archive.download(data, function (err) {
|
|
|
if (err) throw err
|
|
|
console.log('downloaded')
|
|
|
})
|
|
|
})
|
|
|
cb()
|
|
|
},
|
|
|
leave: function (id, cb) {
|
|
|
|
0 comments on commit
c9501c7