You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to connect different react components in the same app to multiple parse servers but I can only connect to one parse server.
App.js is the parent component and App2.js is the child component.
I have started 2 parse servers, each running on different ports.
Parse server A runs on port 1330, 1331 (livequery) while the other server B runs on port 1337, 1338 (livequery). I tried to connect App.js to A and App2.js to B but App2.js still connects to A.
Is it possible to connect App2.js to both server A and B?
in App.js:
import { Parse as UserParse } from "parse";
UserParse.initialize("APP_ID");
UserParse.serverURL = "http://localhost:1330/parse";
UserParse.liveQueryServerURL = "ws://localhost:1331/";
in App2.js:
import {Parse as DataParse } from "parse";
DataParse.initialize("APPLICATION_ID")
DataParse.serverURL = "http://localhost:1337/parse"
DataParse.liveQueryServerURL = "ws://localhost:1338/"
Errors encountered:
Unfortunately you can't do that using the JS SDK. The JS SDK does not support multiple apps,ince some of its methods (for instance, the Parse.initialize()) are static. So any change in the initialization will affect the SDK globally.
If you need to connect to different apps from the client side, you will have to use the REST API or the GraphQL API directly, without using the JS SDK (or using the SDK for one app and one of the APIs for the other app).
I am trying to connect different react components in the same app to multiple parse servers but I can only connect to one parse server.
App.js is the parent component and App2.js is the child component.
I have started 2 parse servers, each running on different ports.
Parse server A runs on port 1330, 1331 (livequery) while the other server B runs on port 1337, 1338 (livequery). I tried to connect App.js to A and App2.js to B but App2.js still connects to A.
Is it possible to connect App2.js to both server A and B?
in App.js:
import { Parse as UserParse } from "parse";
UserParse.initialize("APP_ID");
UserParse.serverURL = "http://localhost:1330/parse";
UserParse.liveQueryServerURL = "ws://localhost:1331/";
in App2.js:
import {Parse as DataParse } from "parse";
DataParse.initialize("APPLICATION_ID")
DataParse.serverURL = "http://localhost:1337/parse"
DataParse.liveQueryServerURL = "ws://localhost:1338/"
Errors encountered:
RESTController.js:205 POST http://localhost:1337/parse/classes/400 (Bad Request)
Uncaught (in promise) Error: Invalid session token at RESTController.js:319
The text was updated successfully, but these errors were encountered: