@@ -10,41 +10,41 @@ var batch = require('./batch'),
10
10
multer = require ( 'multer' ) ,
11
11
Parse = require ( 'parse/node' ) . Parse ;
12
12
13
+ //import passwordReset from './passwordReset';
13
14
import cache from './cache' ;
14
15
import Config from './Config' ;
15
-
16
+ import parseServerPackage from '../package.json' ;
16
17
import ParsePushAdapter from './Adapters/Push/ParsePushAdapter' ;
17
- //import passwordReset from './passwordReset';
18
18
import PromiseRouter from './PromiseRouter' ;
19
+ import requiredParameter from './requiredParameter' ;
19
20
import { AnalyticsRouter } from './Routers/AnalyticsRouter' ;
20
21
import { ClassesRouter } from './Routers/ClassesRouter' ;
21
22
import { FeaturesRouter } from './Routers/FeaturesRouter' ;
22
23
import { FileLoggerAdapter } from './Adapters/Logger/FileLoggerAdapter' ;
23
24
import { FilesController } from './Controllers/FilesController' ;
24
25
import { FilesRouter } from './Routers/FilesRouter' ;
25
26
import { FunctionsRouter } from './Routers/FunctionsRouter' ;
26
- import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter' ;
27
- import { IAPValidationRouter } from './Routers/IAPValidationRouter' ;
28
- import { LogsRouter } from './Routers/LogsRouter' ;
29
- import { HooksRouter } from './Routers/HooksRouter' ;
30
- import { PublicAPIRouter } from './Routers/PublicAPIRouter' ;
31
27
import { GlobalConfigRouter } from './Routers/GlobalConfigRouter' ;
32
-
28
+ import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter' ;
33
29
import { HooksController } from './Controllers/HooksController' ;
34
- import { UserController } from './Controllers/UserController' ;
30
+ import { HooksRouter } from './Routers/HooksRouter' ;
31
+ import { IAPValidationRouter } from './Routers/IAPValidationRouter' ;
35
32
import { InstallationsRouter } from './Routers/InstallationsRouter' ;
36
33
import { loadAdapter } from './Adapters/AdapterLoader' ;
37
34
import { LoggerController } from './Controllers/LoggerController' ;
35
+ import { LogsRouter } from './Routers/LogsRouter' ;
36
+ import { PublicAPIRouter } from './Routers/PublicAPIRouter' ;
38
37
import { PushController } from './Controllers/PushController' ;
39
38
import { PushRouter } from './Routers/PushRouter' ;
39
+ import { randomString } from './cryptoUtils' ;
40
40
import { RolesRouter } from './Routers/RolesRouter' ;
41
41
import { S3Adapter } from './Adapters/Files/S3Adapter' ;
42
42
import { SchemasRouter } from './Routers/SchemasRouter' ;
43
43
import { SessionsRouter } from './Routers/SessionsRouter' ;
44
+ import { setFeature } from './features' ;
45
+ import { UserController } from './Controllers/UserController' ;
44
46
import { UsersRouter } from './Routers/UsersRouter' ;
45
47
46
- import requiredParameter from './requiredParameter' ;
47
- import { randomString } from './cryptoUtils' ;
48
48
// Mutate the Parse object to add the Cloud Code handlers
49
49
addParseCloud ( ) ;
50
50
@@ -106,11 +106,11 @@ function ParseServer({
106
106
passwordResetSuccess : undefined
107
107
} ,
108
108
} ) {
109
-
109
+ setFeature ( 'serverVersion' , parseServerPackage . version ) ;
110
110
// Initialize the node client SDK automatically
111
111
Parse . initialize ( appId , javascriptKey || 'unused' , masterKey ) ;
112
112
Parse . serverURL = serverURL ;
113
-
113
+
114
114
if ( databaseAdapter ) {
115
115
DatabaseAdapter . setAdapter ( databaseAdapter ) ;
116
116
}
@@ -144,7 +144,7 @@ function ParseServer({
144
144
const hooksController = new HooksController ( appId , collectionPrefix ) ;
145
145
const userController = new UserController ( emailControllerAdapter , appId , { verifyUserEmails } ) ;
146
146
147
-
147
+
148
148
cache . apps . set ( appId , {
149
149
masterKey : masterKey ,
150
150
serverURL : serverURL ,
@@ -173,7 +173,7 @@ function ParseServer({
173
173
if ( process . env . FACEBOOK_APP_ID ) {
174
174
cache . apps . get ( appId ) [ 'facebookAppIds' ] . push ( process . env . FACEBOOK_APP_ID ) ;
175
175
}
176
-
176
+
177
177
Config . validate ( cache . apps . get ( appId ) ) ;
178
178
179
179
// This app serves the Parse API directly.
@@ -186,7 +186,7 @@ function ParseServer({
186
186
} ) ) ;
187
187
188
188
api . use ( '/' , bodyParser . urlencoded ( { extended : false } ) , new PublicAPIRouter ( ) . expressApp ( ) ) ;
189
-
189
+
190
190
// TODO: separate this from the regular ParseServer object
191
191
if ( process . env . TESTING == 1 ) {
192
192
api . use ( '/' , require ( './testing-routes' ) . router ) ;
@@ -215,17 +215,17 @@ function ParseServer({
215
215
if ( process . env . PARSE_EXPERIMENTAL_CONFIG_ENABLED || process . env . TESTING ) {
216
216
routers . push ( new GlobalConfigRouter ( ) ) ;
217
217
}
218
-
218
+
219
219
if ( process . env . PARSE_EXPERIMENTAL_HOOKS_ENABLED || process . env . TESTING ) {
220
220
routers . push ( new HooksRouter ( ) ) ;
221
221
}
222
-
222
+
223
223
let routes = routers . reduce ( ( memo , router ) => {
224
224
return memo . concat ( router . routes ) ;
225
225
} , [ ] ) ;
226
226
227
227
let appRouter = new PromiseRouter ( routes ) ;
228
-
228
+
229
229
batch . mountOnto ( appRouter ) ;
230
230
231
231
api . use ( appRouter . expressApp ( ) ) ;
0 commit comments