Permalink
Browse files

0.5.8 Supports directly supplying couchdb url

  • Loading branch information...
1 parent 49ea6bc commit 38668f070efcc561b413fc45d7f46245843f6063 @dscape dscape committed Aug 20, 2011
Showing with 7 additions and 2 deletions.
  1. +6 −1 nano.js
  2. +1 −1 package.json
View
@@ -34,7 +34,12 @@ var request = require('request')
module.exports = exports = nano = function database_module(cfg) {
var public_functions = {};
if(typeof cfg === "string") {
- cfg = require(cfg); // no cfg? maybe it's a file path?
+ try {
+ cfg = require(cfg); // no cfg? maybe it's a file path?
+ }
+ catch(e) {
+ cfg = {url: cfg}; // not a file path? guess it's the url
+ }
}
if(cfg.proxy) {
request = request.defaults({proxy: cfg.proxy}); // proxy support
View
@@ -1,7 +1,7 @@
{ "name": "nano"
, "description": "minimalistic couchdb driver for node.js"
, "homepage": "http://github.com/dscape/nano"
-, "version": "0.5.7"
+, "version": "0.5.8"
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "keywords": ["couchdb", "data", "request", "json", "nosql", "micro", "nano"]
, "dependencies": {"request": "~2.0.5", "underscore": "~1.1.7"}

0 comments on commit 38668f0

Please sign in to comment.