summaryrefslogtreecommitdiff
path: root/app/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-03 12:35:32 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-03 12:35:32 -0400
commit0c4f6ad96c2ee1b1c948dd227e291ff73023b95b (patch)
treeeb3062e04af6162b2a837d79fee1540c7fa773f8 /app/index.js
parentb20d8dd5140833fb46fab29e02e06d35943ce40c (diff)
Directly expose DB impl rather than compose dawg
Diffstat (limited to 'app/index.js')
-rw-r--r--app/index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/index.js b/app/index.js
index f4e9593..29dcfd0 100644
--- a/app/index.js
+++ b/app/index.js
@@ -14,6 +14,7 @@ var OKSchema = require('okschema');
* Basically takes configuration and gives you a server.
*/
function OKCMS(options) {
+ if (!(this instanceof OKCMS)) return new OKCMS(options);
options = options || {};
var root = this._root = options.root || 'www';
var schemaConfig = options.schemas || {};
@@ -21,8 +22,7 @@ function OKCMS(options) {
var viewConfig = options.views || {
'/': { template: 'index' }
};
- // TODO Make configurable
- var db = this._db = new OKDB();
+ var db = new OKDB(options.db || 'fs');
var templateCache = this._templateCache = new OKTemplate({root: root});
var server = this._server = new OKServer({root: root});
// Special query for getting meta info