Initial commit of Google Cloud Storage File Adapter

This commit is contained in:
Mike McDonald
2016-02-27 16:33:34 -08:00
parent db9b72b147
commit 2520e7b6c6
3 changed files with 105 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ import cache from './cache';
import PromiseRouter from './PromiseRouter';
import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter';
import { S3Adapter } from './Adapters/Files/S3Adapter';
import { GCSAdapter } from './Adapters/Files/GCSAdapter';
import { FilesController } from './Controllers/FilesController';
import ParsePushAdapter from './Adapters/Push/ParsePushAdapter';
@@ -91,11 +92,11 @@ function ParseServer({
serverURL = requiredParameter('You must provide a serverURL!'),
maxUploadSize = '20mb'
}) {
// Initialize the node client SDK automatically
Parse.initialize(appId, javascriptKey || 'unused', masterKey);
Parse.serverURL = serverURL;
if (databaseAdapter) {
DatabaseAdapter.setAdapter(databaseAdapter);
}
@@ -103,7 +104,7 @@ function ParseServer({
if (databaseURI) {
DatabaseAdapter.setAppDatabaseURI(appId, databaseURI);
}
if (cloud) {
addParseCloud();
if (typeof cloud === 'function') {
@@ -125,7 +126,7 @@ function ParseServer({
const pushController = new PushController(pushControllerAdapter);
const loggerController = new LoggerController(loggerControllerAdapter);
const hooksController = new HooksController(appId, collectionPrefix);
cache.apps[appId] = {
masterKey: masterKey,
collectionPrefix: collectionPrefix,
@@ -185,7 +186,7 @@ function ParseServer({
if (process.env.PARSE_EXPERIMENTAL_CONFIG_ENABLED || process.env.TESTING) {
routers.push(require('./global_config'));
}
if (process.env.PARSE_EXPERIMENTAL_HOOKS_ENABLED || process.env.TESTING) {
routers.push(new HooksRouter());
}
@@ -229,5 +230,6 @@ function getClassName(parseClass) {
module.exports = {
ParseServer: ParseServer,
S3Adapter: S3Adapter
S3Adapter: S3Adapter,
GCSAdapter: GCSAdapter
};