Skip to content

Commit 16b6ec4

Browse files
committed
Merge pull request #1153 from ParsePlatform/flovilmart.fixBrokenParseServerClass
Mounts createLiveQueryServer, fix babel induced problem
2 parents f5fdedf + ddb76a8 commit 16b6ec4

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

spec/index.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,12 @@ describe('server', () => {
228228
done();
229229
})
230230
});
231+
232+
it('has createLiveQueryServer', done => {
233+
// original implementation through the factory
234+
expect(typeof ParseServer.ParseServer.createLiveQueryServer).toEqual('function');
235+
// For import calls
236+
expect(typeof ParseServer.default.createLiveQueryServer).toEqual('function');
237+
done();
238+
});
231239
});

src/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ addParseCloud();
7979
// "javascriptKey": optional key from Parse dashboard
8080
// "push": optional key from configure push
8181

82-
export default class ParseServer {
82+
class ParseServer {
8383

8484
constructor({
8585
appId = requiredParameter('You must provide an appId!'),
@@ -270,25 +270,25 @@ export default class ParseServer {
270270
return api;
271271
}
272272

273-
static ParseServer(options) {
274-
let server = new ParseServer(options);
275-
return server.app;
276-
}
277-
278273
static createLiveQueryServer(httpServer, config) {
279274
return new ParseLiveQueryServer(httpServer, config);
280275
}
281276
}
282277

278+
// Factory function
279+
let _ParseServer = function(options) {
280+
let server = new ParseServer(options);
281+
return server.app;
282+
}
283+
// Mount the create liveQueryServer
284+
_ParseServer.createLiveQueryServer = ParseServer.createLiveQueryServer;
285+
283286
function addParseCloud() {
284287
const ParseCloud = require("./cloud-code/Parse.Cloud");
285288
Object.assign(Parse.Cloud, ParseCloud);
286289
global.Parse = Parse;
287290
}
288291

289-
let runServer = function(options) {
290-
return ParseServer.ParseServer(options);
291-
}
292-
292+
export default ParseServer;
293293
export { S3Adapter, GCSAdapter, FileSystemAdapter };
294-
export { runServer as ParseServer };
294+
export { _ParseServer as ParseServer };

0 commit comments

Comments
 (0)