我正在将我的第一个环回应用程序部署到Openshift。但这是行不通的。我已经创建了一个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'
}
};
model-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 tail显示错误消息
帐户引用的数据源不存在:“ myDB”
这不是正确的方法吗???
最佳答案
我已经通过将回送引导升级到版本2.9.0解决了该问题。问题出在回送启动版本2.6.5上,必须修改连接URL。