Mongodb和Loopback,同时部署在openshift上

我正在将我的第一个环回应用程序部署到Openshift。 但它不工作。 我已经创build了一个datasources.local.js文件。 并做了一些改变。

datasources.local.js

module.exports = { myDB: { connector: 'loopback-connector-mongodb', host: 'mongodb://$OPENSHIFT_MONGODB_DB_HOST', port: '$OPENSHIFT_MONGODB_DB_PORT', database: 'even3co', username: 'admin', password: 'ZWQbMQpvMz-F' } }; 

模型config.json

 { "_meta": { "sources": [ "loopback/common/models", "loopback/server/models", "../common/models", "./models" ], "mixins": [ "loopback/common/mixins", "loopback/server/mixins", "../common/mixins", "./mixins" ] }, "User": { "dataSource": "db" }, "AccessToken": { "dataSource": "db", "public": false }, "ACL": { "dataSource": "db", "public": false }, "RoleMapping": { "dataSource": "db", "public": false }, "Role": { "dataSource": "db", "public": false }, "Account": { "dataSource": "myDB", "public": true } } 

datasources.json

 { "db": { "name": "db", "connector": "memory" }, "myFile": { "name": "myFile", "connector": "loopback-component-storage", "provider": "filesystem", "root": "./server/storage" } } 

而rhc尾部显示一条错误消息

帐户引用一个不存在的数据源:“myDB”

这不正确吗?

       

网上收集的解决方案 "Mongodb和Loopback,同时部署在openshift上"