diff options
Diffstat (limited to 'app/index.js')
| -rw-r--r-- | app/index.js | 4 |
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 |
