summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorjulie lala <jules@okfoc.us>2015-05-17 08:07:06 -0400
committerjulie lala <jules@okfoc.us>2015-05-17 08:07:06 -0400
commit45197dbb5a49c75509d95fae072f828bdbc7e13e (patch)
treeb9e177b49203d6e73b3c9e15f8ce59b8b32b50c8 /app
parent7f84dfb770ac2f9bae282ef00d9a93f21255fa45 (diff)
parenta0d2729e311f53ecaa014c097c1a485581853100 (diff)
Merge branch 'twohustlers' of github.com:okfocus/okcms into twohustlers
Diffstat (limited to 'app')
-rw-r--r--app/index.js7
-rw-r--r--app/node_modules/okdb/index.js3
-rw-r--r--app/node_modules/okserver/index.js5
3 files changed, 9 insertions, 6 deletions
diff --git a/app/index.js b/app/index.js
index 5ac88dd..963bfd0 100644
--- a/app/index.js
+++ b/app/index.js
@@ -36,11 +36,13 @@ function OKCMS(options) {
var templateRoot = options.templateRoot || 'templates';
var adminTemplateRoot = options.templateRoot ||
path.join(__dirname, '../themes/okadmin/templates');
- var debug = options.debug || false;
+ var debug = !!options.debug;
+ var production = !!options.production;
var metaUser = options.meta || {};
var metaDefault = {
project: 'OKCMS',
+ production: production,
debug: debug
};
@@ -116,7 +118,10 @@ OKCMS.prototype._createSchemas = function(schemaConfig) {
return Object.keys(schemaConfig).reduce(function(cache, key) {
var spec = schemaConfig[key];
// All resources have an autoincrementing index so we can order them suckas
+ // TODO Screw the __ prefix, just consider 'index' a reserved word
spec.__index = {type: 'meta', autoincrement: true};
+ // All resources have a dateCreated field
+ spec.dateCreated = {type: 'meta'};
cache[key] = OKSchema(spec);
return cache;
}, {});
diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js
index 5aa22a2..4820c8c 100644
--- a/app/node_modules/okdb/index.js
+++ b/app/node_modules/okdb/index.js
@@ -68,6 +68,9 @@ FSDB.prototype.insert = function(collection, data) {
data = cloneDeep(data);
// Auto-increment fields
data = autoincrement(wrapped, schema, data);
+ // Record date created
+ // TODO Should this meta prop logic be moved out of the DB?
+ data.dateCreated = new Date().toUTCString();
var result = wrapped.chain().push(data).last().value();
if (result) {
diff --git a/app/node_modules/okserver/index.js b/app/node_modules/okserver/index.js
index abca8b5..6d0ed17 100644
--- a/app/node_modules/okserver/index.js
+++ b/app/node_modules/okserver/index.js
@@ -52,11 +52,6 @@ function OKServer(options) {
* other middleware.
*/
- // Intercept favicon requests and 404 for now
- app.use('/favicon.ico', function(req, res) {
- res.status(404)
- return res.send('');
- });
// Serve user static files
app.use(express.static(root));
// Serve admin interface static files