Skip to content

Separate the Parse Server with the LiveQuery Server #2616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hsz1992 opened this issue Aug 30, 2016 · 4 comments
Closed

Separate the Parse Server with the LiveQuery Server #2616

hsz1992 opened this issue Aug 30, 2016 · 4 comments
Assignees
Labels
type:bug Impaired feature or lacking behavior that is likely assumed type:question Support or code-level question

Comments

@hsz1992
Copy link

hsz1992 commented Aug 30, 2016

Here is my code:

var express = require('express');
var ParseServer = require('parse-server').ParseServer;

var app = express();

var httpServer = require('http').createServer(app);
httpServer.listen(2337);

ParseServer.createLiveQueryServer(httpServer, {
  appId: 'appId',
  masterKey: 'masterKey',
  serverURL: 'http://localhost:1337/parse',
  redisURL: 'redis://localhost:6379'
});

And its output:

/path/to/project/node_modules/.npminstall/parse-server/2.2.18/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:85
    _logger2.default.verbose('Support key pairs', this.keyPairs);
                    ^

TypeError: Cannot read property 'verbose' of undefined
    at new ParseLiveQueryServer (/path/to/project/node_modules/.npminstall/parse-server/2.2.18/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:85:21)
    at Function.createLiveQueryServer (/path/to/project/node_modules/.npminstall/parse-server/2.2.18/parse-server/lib/ParseServer.js:417:14)
    at Object.<anonymous> (/path/to/project/index.js:15:13)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
@hsz1992
Copy link
Author

hsz1992 commented Aug 30, 2016

I fixed it by create a Parse Server instance.

var express = require('express');
var ParseServer = require('parse-server').ParseServer;

// +++++ BEGIN +++++
new ParseServer({
  appId: '',
  masterKey: '',
  serverURL: '',
});
// +++++ END +++++

var app = express();

var httpServer = require('http').createServer(app);
httpServer.listen(2337);

ParseServer.createLiveQueryServer(httpServer, {
  appId: 'appId',
  masterKey: 'masterKey',
  serverURL: 'http://localhost:1337/parse',
  redisURL: 'redis://localhost:6379'
});

And its output:

info: Parse LiveQuery Server starts running

@hsz1992
Copy link
Author

hsz1992 commented Aug 30, 2016

The loggerControllerAdapter not set when I create a separate LiveQuery Server.

@flovilmart
Copy link
Contributor

I'll work on a fix for that as it's a regression. In the meantime, you can use the workaround. (I was about to suggest the same)

@hsz1992
Copy link
Author

hsz1992 commented Aug 30, 2016

@flovilmart Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants