Last active
August 29, 2015 14:24
-
-
Save beaucollins/9ccf7e7a9c2e6ecbabab to your computer and use it in GitHub Desktop.
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 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); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I uploaded new stuff through the browser I was hoping the
collectionsevent listener would be called.Also, if I don't use
cloudup-localas theUser-Agentthe documents are loaded with a prefix of: