overleaf/services/filestore/app/coffee/PersistorManager.coffee

16 lines
437 B
CoffeeScript
Raw Normal View History

settings = require("settings-sharelatex")
logger = require("logger-sharelatex")
2014-02-26 06:58:48 -05:00
# assume s3 if none specified
settings.filestoreBackend ||= "s3"
2014-02-26 06:49:15 -05:00
logger.log backend:settings.filestoreBackend, "Loading backend"
module.exports = switch settings.filestoreBackend
2014-02-26 06:58:48 -05:00
when "s3"
require("./S3PersistorManager")
when "fs"
require("./FSPersistorManager")
else
2014-02-26 06:49:15 -05:00
throw new Error( "Unknown filestore backend: #{settings.filestoreBackend}" )