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

18 lines
494 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.filestore.backend ||= "s3"
2014-02-26 06:58:48 -05: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}" )