Mounts createLiveQueryServer, fix babel induced problem
This commit is contained in:
@@ -228,4 +228,12 @@ describe('server', () => {
|
||||
done();
|
||||
})
|
||||
});
|
||||
|
||||
it('has createLiveQueryServer', done => {
|
||||
// original implementation through the factory
|
||||
expect(typeof ParseServer.ParseServer.createLiveQueryServer).toEqual('function');
|
||||
// For import calls
|
||||
expect(typeof ParseServer.default.createLiveQueryServer).toEqual('function');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
22
src/index.js
22
src/index.js
@@ -79,7 +79,7 @@ addParseCloud();
|
||||
// "javascriptKey": optional key from Parse dashboard
|
||||
// "push": optional key from configure push
|
||||
|
||||
export default class ParseServer {
|
||||
class ParseServer {
|
||||
|
||||
constructor({
|
||||
appId = requiredParameter('You must provide an appId!'),
|
||||
@@ -270,25 +270,25 @@ export default class ParseServer {
|
||||
return api;
|
||||
}
|
||||
|
||||
static ParseServer(options) {
|
||||
let server = new ParseServer(options);
|
||||
return server.app;
|
||||
}
|
||||
|
||||
static createLiveQueryServer(httpServer, config) {
|
||||
return new ParseLiveQueryServer(httpServer, config);
|
||||
}
|
||||
}
|
||||
|
||||
// Factory function
|
||||
let _ParseServer = function(options) {
|
||||
let server = new ParseServer(options);
|
||||
return server.app;
|
||||
}
|
||||
// Mount the create liveQueryServer
|
||||
_ParseServer.createLiveQueryServer = ParseServer.createLiveQueryServer;
|
||||
|
||||
function addParseCloud() {
|
||||
const ParseCloud = require("./cloud-code/Parse.Cloud");
|
||||
Object.assign(Parse.Cloud, ParseCloud);
|
||||
global.Parse = Parse;
|
||||
}
|
||||
|
||||
let runServer = function(options) {
|
||||
return ParseServer.ParseServer(options);
|
||||
}
|
||||
|
||||
export default ParseServer;
|
||||
export { S3Adapter, GCSAdapter, FileSystemAdapter };
|
||||
export { runServer as ParseServer };
|
||||
export { _ParseServer as ParseServer };
|
||||
|
||||
Reference in New Issue
Block a user