-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mongoose dependency
- Loading branch information
lmarkus
committed
Dec 4, 2013
1 parent
9df01dd
commit b071b53
Showing
2 changed files
with
57 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* A custom library to establish a database connection | ||
*/ | ||
'use strict'; | ||
var mongoose = require('mongoose'); | ||
|
||
var db = function () { | ||
return { | ||
|
||
/** | ||
* Open a connection to the database | ||
* @param conf | ||
*/ | ||
config: function (conf) { | ||
mongoose.connect('mongodb://' + conf.host + '/' + conf.database); | ||
var db = mongoose.connection; | ||
db.on('error', console.error.bind(console, 'connection error:')); | ||
db.once('open', function callback() { | ||
console.log('db connection open'); | ||
}); | ||
} | ||
}; | ||
}; | ||
|
||
module.exports = db(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
{ | ||
"name": "kraken-example-shopping-cart", | ||
"version": "0.0.1", | ||
"description": "A non-trivial kraken app", | ||
"author": "@LennyMarkus", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt test", | ||
"start": "node index.js" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"dependencies": { | ||
"kraken-js": "~0.6.1", | ||
"express": "~3.4.4", | ||
"adaro": "~0.1.x", | ||
"nconf": "~0.6.8", | ||
"less": "~1.3.3", | ||
"dustjs-linkedin": "~2.0.3", | ||
"dustjs-helpers": "~1.1.1", | ||
"makara": "~0.3.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.10.0", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-less": "~0.7.0", | ||
"grunt-dustjs": "~1.1.1", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-jshint": "~0.6.4", | ||
"grunt-mocha-cli": "~1.3.0" | ||
} | ||
"name": "kraken-example-shopping-cart", | ||
"version": "0.0.1", | ||
"description": "A non-trivial kraken app", | ||
"author": "@LennyMarkus", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt test", | ||
"start": "node index.js" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"dependencies": { | ||
"kraken-js": "~0.6.1", | ||
"express": "~3.4.4", | ||
"adaro": "~0.1.x", | ||
"nconf": "~0.6.8", | ||
"less": "~1.3.3", | ||
"dustjs-linkedin": "~2.0.3", | ||
"dustjs-helpers": "~1.1.1", | ||
"makara": "~0.3.0", | ||
"mongoose": "~3.8.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.10.0", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-less": "~0.7.0", | ||
"grunt-dustjs": "~1.1.1", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-jshint": "~0.6.4", | ||
"grunt-mocha-cli": "~1.3.0" | ||
} | ||
} |