mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 05:01:12 +00:00
26 lines
644 B
JavaScript
26 lines
644 B
JavaScript
const settings = require('settings-sharelatex')
|
|
const logger = require('logger-sharelatex')
|
|
|
|
logger.log(
|
|
{
|
|
backend: settings.filestore.backend
|
|
},
|
|
'Loading backend'
|
|
)
|
|
if (!settings.filestore.backend) {
|
|
throw new Error('no backend specified - config incomplete')
|
|
}
|
|
|
|
switch (settings.filestore.backend) {
|
|
case 'aws-sdk':
|
|
module.exports = require('./AWSSDKPersistorManager')
|
|
break
|
|
case 's3':
|
|
module.exports = require('./S3PersistorManager')
|
|
break
|
|
case 'fs':
|
|
module.exports = require('./FSPersistorManager')
|
|
break
|
|
default:
|
|
throw new Error(`unknown filestore backend: ${settings.filestore.backend}`)
|
|
}
|