diff options
Diffstat (limited to 'protoype/mydb.js')
-rw-r--r-- | protoype/mydb.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/protoype/mydb.js b/protoype/mydb.js new file mode 100644 index 0000000..4a58580 --- /dev/null +++ b/protoype/mydb.js @@ -0,0 +1,18 @@ +/* + * db.js + * + * database include file + * + */ + +var dburl = 'localhost/nodejs1'; +var collections = ['users']; +var db = require('mongojs').connect(dburl, collections); + + +/* this has to be 'module.exports' so that when this module is require'd the + * exported object that in this case is 'db' will be a reference instead of an + * undefined object + */ +module.exports = db; + |