Skip to content

Instantly share code, notes, and snippets.

@beaucollins
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save beaucollins/9ccf7e7a9c2e6ecbabab to your computer and use it in GitHub Desktop.

Select an option

Save beaucollins/9ccf7e7a9c2e6ecbabab to your computer and use it in GitHub Desktop.
var mydb = require('./index.js');
var cloudup = new mydb("https://nio8.cloudup.com", {
baseURL: "https://cloudup.com",
headers: {
"Authorization": "Basic " + (new Buffer([process.env.USERNAME, process.env.PASSWORD].join(':')).toString("base64")),
'User-Agent': 'cloudup-local'}
});
cloudup.on('connect', function() {
});
var doc = cloudup.get("/users/me");
doc.on('$state', function(state) {
if (state == 'loaded') {
console.log('doc');
}
});
doc.on('collections', function(c) {
console.log("Collections", c);
});
@beaucollins
Copy link
Copy Markdown
Author

When I uploaded new stuff through the browser I was hoping the collections event listener would be called.

Also, if I don't use cloudup-local as the User-Agent the documents are loaded with a prefix of:

while(1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment