Option to ignore parse file storage (#2222)

* flag in configurations to use only files adapter

* added lib folder

* remove lib

* alignment edit

* replace comma with semicolon

* ignore parse file storage if fileKey is not provided (undefined)
This commit is contained in:
OzgeAkin
2016-07-10 19:15:30 +02:00
committed by Drew
parent 1fb7679b22
commit 6dc8d287d6
2 changed files with 10 additions and 6 deletions

View File

@@ -64,12 +64,16 @@ export class FilesController extends AdaptableController {
// all filenames starting with "tfss-" should be from files.parsetfss.com
// all filenames starting with a "-" seperated UUID should be from files.parse.com
// all other filenames have been migrated or created from Parse Server
if (filename.indexOf('tfss-') === 0) {
fileObject['url'] = 'http://files.parsetfss.com/' + config.fileKey + '/' + encodeURIComponent(filename);
} else if (legacyFilesRegex.test(filename)) {
fileObject['url'] = 'http://files.parse.com/' + config.fileKey + '/' + encodeURIComponent(filename);
} else {
if (config.fileKey === undefined) {
fileObject['url'] = this.adapter.getFileLocation(config, filename);
} else {
if (filename.indexOf('tfss-') === 0) {
fileObject['url'] = 'http://files.parsetfss.com/' + config.fileKey + '/' + encodeURIComponent(filename);
} else if (legacyFilesRegex.test(filename)) {
fileObject['url'] = 'http://files.parse.com/' + config.fileKey + '/' + encodeURIComponent(filename);
} else {
fileObject['url'] = this.adapter.getFileLocation(config, filename);
}
}
}
}

View File

@@ -109,7 +109,7 @@ class ParseServer {
dotNetKey,
restAPIKey,
webhookKey,
fileKey = 'invalid-file-key',
fileKey = undefined,
facebookAppIds = [],
enableAnonymousUsers = true,
allowClientClassCreation = true,