Skip to content
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

calling another Parse Server #5278

Closed
oallouch opened this issue Jan 4, 2019 · 3 comments
Closed

calling another Parse Server #5278

oallouch opened this issue Jan 4, 2019 · 3 comments

Comments

@oallouch
Copy link
Contributor

oallouch commented Jan 4, 2019

Hi everyone,

As parse-server and the js sdk both use the Parse global variable, is it possible for me to call another Parse Server from hooks (other than using the REST API) ?

Thx in advance,
Olivier

@flovilmart
Copy link
Contributor

Not advised as you’d override the current Parse SDK setup

@oallouch
Copy link
Contributor Author

oallouch commented Jan 4, 2019

So I have to use REST calls ? Too bad, but I can understand.
I guess I love parse too much and use it on too many projects :)

@coderofsalvation
Copy link

coderofsalvation commented Dec 7, 2020

I have a multi-app parse-server running, and was able to do inter-app communication like so:

      let initializeMulti = (appId, javascriptKey, masterKey) => {     
        Object.keys(require.cache).forEach(function(key) { delete require.cache[key] })
        var _Parse = require('parse/node')
        _Parse.initialize( appId, javascriptKey, masterKey )
        _Parse.Cloud = Parse.Cloud                                                                                                
        return _Parse
      }                                                                                                                   
      Parse.otherParse = initializeMulti(  appId, javascriptKey, masterKey )        
      Parse.otherParse.serverURL = "http://.."                    

NOTE: in cloud functions Parse.otherParse might be needed instead of Parse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants