mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
15da975c06
issue #635 - upload controller shouldn't assume fs - filesystem module proxies all the fs work - proxies and exposes middleware for serving images - creating a date based path and unique filename is a base object util - unit tests updated
22 lines
525 B
JavaScript
22 lines
525 B
JavaScript
var errors = require('../errorHandling'),
|
|
storage;
|
|
|
|
function get_storage() {
|
|
// TODO: this is where the check for storage plugins should go
|
|
// Local file system is the default
|
|
var storageChoice = 'localfilesystem';
|
|
|
|
if (storage) {
|
|
return storage;
|
|
}
|
|
|
|
try {
|
|
// TODO: determine if storage has all the necessary methods
|
|
storage = require('./' + storageChoice);
|
|
} catch (e) {
|
|
errors.logError(e);
|
|
}
|
|
return storage;
|
|
}
|
|
|
|
module.exports.get_storage = get_storage; |