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

16 lines
441 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
settings.filestore.backend ||= "s3"
2014-02-26 11:58:48 +00:00
logger.log backend:settings.filestore.backend, "Loading backend"
module.exports = switch settings.filestore.backend
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}" )