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