如何运行带功能的Firebase模拟器进行本地开发,在远程数据库上触发?

问题描述 投票:0回答:1

我正在构建具有云功能的Firebase API,并希望访问我的生产数据库以进行本地测试。我的问题:


[当我使用]启动两个Firebase模拟器(函数和Firestore)时>

firebase emulators:start 

1-我的自定义API端点在http://localhost:5001上运行(有效)

2-我的触发器到达http://localhost:8080上的本地数据库,而我没有设置FIRESTORE_EMULATOR_HOST = localhost:8080(我想访问我的生产数据库

]]

OR

当我仅使用]启动“功能仿真器”时>

firebase emulators:start --only function

...但是未达到我的触发器,可能是由于此警告的缘故

i  functions[userOnCreate]: function ignored because the firestore emulator does not exist or is not running.

另一方面,我也在使用在本地主机上运行的Firebase构建了Reactjs应用程序:3000

我使用Firebase SDK从此应用程序调用本地API。为了达到我的模拟器,我添加了一行:

firebase.functions.useFunctionsEmulator('http://localhost:5001');

我正在构建具有云功能的Firebase API,并希望访问我的生产数据库以进行本地测试。我的问题:当我使用...

firebase google-cloud-firestore localhost google-cloud-functions firebase-cli
1个回答
1
投票
您总是有空file a feature request
© www.soinside.com 2019 - 2024. All rights reserved.