Created
January 18, 2012 21:09
-
-
Save mamund/1635675 to your computer and use it in GitHub Desktop.
Cradle w/ credentials option
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
// for couch | |
var cradle = require('cradle'); | |
var host = 'https://xxxx.cloudant.com'; | |
var port = 443; | |
var credentials = {username: 'xxxx', password: 'xxxx' }; | |
var local=false; | |
var db; | |
if(local===true) { | |
db = new(cradle.Connection)().database('xxxx'); | |
} | |
else { | |
db = new(cradle.Connection)(host, port, {auth: credentials}).database('xxx'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment