|
|
@ -60,21 +60,19 @@ if (config.recompressStaticAssets) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Send the static documents into the preferred store, skipping expirations
|
|
|
|
// Send the static documents into the preferred store, skipping expirations
|
|
|
|
|
|
|
|
var path, data; |
|
|
|
for (var name in config.documents) { |
|
|
|
for (var name in config.documents) { |
|
|
|
var path = config.documents[name]; |
|
|
|
path = config.documents[name]; |
|
|
|
fs.readFile(path, 'utf8', function(err, data) { |
|
|
|
data = fs.readFileSync(path, 'utf8'); |
|
|
|
if (data && !err) { |
|
|
|
winston.info('loading static document', { name: name, path: path }); |
|
|
|
preferredStore.set(name, data, function(cb) { |
|
|
|
if (data) { |
|
|
|
winston.info('loaded static document', { name: name, path: path }); |
|
|
|
preferredStore.set(name, data, function(cb) { |
|
|
|
}, true); |
|
|
|
winston.debug('loaded static document', { success: cb }); |
|
|
|
} |
|
|
|
}, true); |
|
|
|
else { |
|
|
|
} |
|
|
|
winston.warn( |
|
|
|
else { |
|
|
|
'failed to load static document', |
|
|
|
winston.warn('failed to load static document', { name: name, path: path }); |
|
|
|
{ name: name, path: path } |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Pick up a key generator
|
|
|
|
// Pick up a key generator
|
|
|
|