@@ -10,10 +10,14 @@ var batch = require('./batch'),
1010 PromiseRouter = require ( './PromiseRouter' ) ,
1111 httpRequest = require ( './httpRequest' ) ;
1212
13- var ParseApp = require ( './classes/ParseApp' ) . default ;
14- var CacheProvider = require ( './classes/CacheProvider' ) . default ;
15- var FilesProvider = require ( './classes/FilesProvider' ) . default ;
16- var DatabaseProvider = require ( './classes/DatabaseProvider' ) . default ;
13+ import { default as ParseApp } from './classes/ParseApp' ;
14+ import { default as CacheProvider } from './classes/CacheProvider' ;
15+ import { default as FilesProvider } from './classes/FilesProvider' ;
16+ import { default as DatabaseProvider } from './classes/DatabaseProvider' ;
17+
18+ import { default as DEFAULT_CACHE_ADAPTER } from './classes/MemoryCache' ;
19+ import { default as DEFAULT_FILES_ADAPTER } from './GridStoreAdapter' ;
20+ import { default as DEFAULT_DATABASE_ADAPTER } from './ExportAdapter' ;
1721
1822// Mutate the Parse object to add the Cloud Code handlers
1923addParseCloud ( ) ;
@@ -41,11 +45,29 @@ addParseCloud();
4145// "restAPIKey": optional key from Parse dashboard
4246// "javascriptKey": optional key from Parse dashboard
4347
48+ const SERVER_DEFAULT_CONFIG = {
49+ "cache" : {
50+ adapter : DEFAULT_CACHE_ADAPTER ,
51+ options : {
52+ defaultTtl : 10 * 60 * 1000 // 10 min in ms
53+ }
54+ } ,
55+ "files" : {
56+ adapter : DEFAULT_FILES_ADAPTER ,
57+ options : { }
58+ } ,
59+ "database" : {
60+ adapter : DEFAULT_DATABASE_ADAPTER ,
61+ databaseURI : "mongodb://localhost:27017/parse" ,
62+ options : { }
63+ }
64+ }
65+
4466function ParseServer ( args ) {
4567 // Setup providers
46- CacheProvider . setup ( args . cache ) ;
47- FilesProvider . setup ( args . files ) ;
48- DatabaseProvider . setup ( args . database ) ;
68+ CacheProvider . setup ( args . cache , SERVER_DEFAULT_CONFIG . cache ) ;
69+ FilesProvider . setup ( args . files , SERVER_DEFAULT_CONFIG . files ) ;
70+ DatabaseProvider . setup ( args . database , SERVER_DEFAULT_CONFIG . database ) ;
4971
5072 // Instantiate the app
5173 var app = new ParseApp ( args . app ) ;
0 commit comments