-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unable to query classes in cloud functions when we define multiple apps. #5988
Comments
I think the problem happens because the second app is mounted in a nested route. Try to mount the second app in another route, maybe: |
Hi @davimacedo , thanks for the response. I have tried as you mentioned, but no luck.. :( tried this one also :
|
Can you please share your most updated code including the lines that you are using to initiate Parse Server and the ones that you are mounting the apis to your Express.js app? I will try to simulate the problem. |
Hi @davimacedo, Please find the logs what i have tried and also attached app.js cloud function POST method refers to /cwapp/functions/getTestDB, But Query in cloud function is referring to /app1/classes instead of /cwapp/classes
I have added app.js content in the below attachment. i have also added mlab url for reference too. Only cwapp is pointing to mLab url, rest of the apps to local mongodb url .env file :
package.json :
Cloud Function: cloud/cwapp/main.js
Note: if i am changing the order from to works fine....but app1 got effected this time. |
Thanks for sending the detailed information. I've just gone through your code and I've figured out that it will actually not work. Since the apps are instantiated under the same Node.js process, they are sharing the same Parse JS SDK. But the JS SDK was designed to connect to a single server URL as you can see here. The So here it goes your options:
Since this issue is actually the same of https://github.com/parse-community/parse-server/blob/master/src/ParseServer.js#L66, I will close this one and we can keep following up the other. |
Issue Description
I have created 2 apps using parse-server and parse-dashboard. Both the apps have different mongodb uris.
I have verified in API Console, which returns the results of the class successfully.
But I am trying to write cloud function for one app ('cwapp').
Curl command :
But while i am trying to query the class within the cloud function it throws an error.
Here is my cloud function code in the same file (cloud/cwapp/main.js)
I am suspecting cloud functions unable to access its own database which is configured for app (cwapp) while i am using cloud functions.
Steps to reproduce
Expected Results
Cloud function should return the results of the TestDB classes.
Actual Outcome
Getting an error :
Environment Setup
Server
Database
Logs/Trace
The text was updated successfully, but these errors were encountered: