[英]how to configure loopback 4 with firestore datasource
I am trying to configure loopback4 with firestore data source using loopback-connector-firestore connector. 我正在尝试使用loopback-connector-firestore连接器使用firestore数据源配置loopback4。 when i am trying to post it is showing error code 500 with Error: Internal Server Error. 当我尝试发布时,它显示错误代码500,错误为:Internal Server Error。 Please tell me where i am exactly doing wrong. 请告诉我我到底在做错什么。
It is simple. 很简单。
lb4 datasource
. 首先,按照以下步骤运行控制台命令lb4 datasource
创建数据lb4 datasource
。 other
. 当命令行要求您提供连接器时,请选择“ other
。 loopback-connector-firestore
. 当命令行要求您提供连接器的软件包名称时,请粘贴此loopback-connector-firestore
。 Please note that all connector for loopback 3 must work in loopback 4. 请注意,回送3的所有连接器必须在回送4中工作。 src/datasources
project folder open your new datasourceName.datasource.json
file and add the following keys that you can find in the downloaded JSON file from the Google Cloud Platform in the previous step: 然后在src/datasources
项目文件夹中,打开新的datasourceName.datasource.json
文件,并添加以下密钥,您可以在上一步中从Google Cloud Platform下载的JSON文件中找到以下密钥: {
"projectId": "",
"clientEmail": "",
"privateKey": "",
"databaseName": "Optional, Default: projectId"
}
That is all. 就这些。 Now, if you have models, repositories and controller previously created you can run npm start
, open the explorer and test your endpoints. 现在,如果您具有先前创建的模型,存储库和控制器,则可以运行npm start
,打开资源管理器并测试端点。
Regards. 问候。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.