node.js - 在一个 Node.js 环境中运行多个 Parse 服务器实例

标签 node.js parse-platform jelastic

有没有办法在一个 Node.js(一台机器)环境中运行多个 Parse 服务器实例?如果是的话,配置是什么。

我专门针对 Jelastic,但我认为通用解决方案无论如何都是适用的。

最佳答案

我正在使用这种方式,并且效果很好

// First app instance here

var api1 = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/dev1',
  cloud: '/home/myApp/cloud/main1.js',
  appId: 'myAppId1',
  masterKey: 'myMasterKey1',
  fileKey: 'optionalFileKey1',
  serverURL: 'http://localhost:1337/parse'
});

// Second app instance here

var api2 = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/dev2', // Connection string foryour MongoDB database
  cloud: '/home/myApp/cloud/main2.js', // Absolute path to your Cloud Code
  appId: 'myAppId2',
  masterKey: 'myMasterKey2', // Keep this key secret!
  fileKey: 'optionalFileKey',
 serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
});


// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';

// Mount Apps here
app.use(mountPath, api1);
app.use(mountPath, api2);

希望这有帮助!让我知道

enter image description here

关于node.js - 在一个 Node.js 环境中运行多个 Parse 服务器实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41265702/

相关文章:

java - 两个 REST 服务之间的通信

java - Tomcat9 Log4j2 - 两个服务器之间的日志记录不同

mysql - NodeJS Mysql 停止服务器因错误而崩溃

javascript - Sequelize - 检查数组中是否有任何字符串包含字符串

ios - 如何在 Parse 中使用重复的用户名检查注册

ios - SIGABRT - 目标解析推送通知

java - 无法通过启用 proguard+using parse sdk 1.8.2 导出 Android 应用程序

node.js - Docker 文件来自 Node :12. 2.0-alpine

node.js - 使用服务帐户 key 列出来自谷歌驱动器的公开共享文件未获取公共(public)文件

Jelastic 和 Jetty 9 上的 SSL