I worked all week to transfer my applications hosted on parse.com to the server parsing, everything was done perfectly, the only problem is getting it to run several applications on the same equipment without my dedicated server application for this, it will be expensive.
I read this discussion about this, and based on this, do the following solution:
var app1 = new ParseServer({ databaseURI: databaseUri || 'mongodb://localhost:27017/dev', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'myAppId1', masterKey: process.env.MASTER_KEY || 'myMasterKey1', //Add your master key here. Keep it secret! serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed push: pushConfig, liveQuery: { classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions } }); var app2 = new ParseServer({ databaseURI: databaseUri || 'mongodb://localhost:27017/app2', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'myAppId2', masterKey: process.env.MASTER_KEY || 'myMasterKey2', //Add your master key here. Keep it secret! serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed push: pushConfig, liveQuery: { classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions } }); // Client-keys like the javascript key or the .NET key are not necessary with parse-server // If you wish you require them, you can set them as options in the initialization above: // javascriptKey, restAPIKey, dotNetKey, clientKey var app = express(); // Serve static assets from the /public folder app.use('/public', express.static(path.join(__dirname, '/public'))); // Serve the Parse API on the /parse URL prefix var mountPath = process.env.PARSE_MOUNT || '/parse'; app.use(mountPath, app1); app.use(mountPath, app2);
This works until the time testing environment can use several applications to send push to the same equipment, simply by creating several instances of the server parsing, pointing to different databases.
Can someone tell me if something could go wrong with applications in production? Could this cause me problems in the future?
Does anyone support this solution?
Thanks!