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

17 lines
499 B
CoffeeScript
Raw Normal View History

settings = require("settings-sharelatex")
logger = require("logger-sharelatex")
2014-02-26 11:58:48 +00:00
# assume s3 if none specified
2018-05-21 09:11:47 +00:00
settings?.filestore?.backend ||= "s3"
2014-02-26 11:58:48 +00:00
2018-05-21 10:02:53 +00:00
logger.log backend:settings?.filestore?.backend, "Loading backend"
module.exports = switch settings?.filestore?.backend
when "aws-sdk"
require "./AWSSDKPersistorManager"
2014-02-26 11:58:48 +00:00
when "s3"
require("./S3PersistorManager")
when "fs"
require("./FSPersistorManager")
else
throw new Error( "Unknown filestore backend: #{settings.filestore.backend}" )