是否有人知道是否有一种方法可以用http 的地址(而不是默认的地址)初始化Firebase函数(使用模拟器进行本地调试)?我试图调试一个电报,与机器人相关的脚本,电报只允许http的网络钩子。
Shell输出如下:
PS C:\Users\<user>\Desktop\tmp_node\functions> firebase emulators:start --only functions
i emulators: Starting emulators: functions
+ hub: emulator hub started at http://localhost:4400
+ functions: Using node@10 from host.
+ functions: functions emulator started at http://localhost:8443
i functions: Watching "C:\Users\<user>\Desktop\tmp_node\functions" for Cloud Functions...
+ functions[<function name>]: http function initialized (http://localhost:8443/<endpoint>).
+ emulators: All emulators started, it is now safe to connect.我需要它从https://localhost:8443/开始。
非常感谢您提前!
发布于 2021-05-21 16:37:35
就像评论中提到的@bermick一样,ngrok是一个很好的解决方法,直到Firebase给我们一种在本地模拟器上启用https的方法。以下是几个步骤:
ngrok二进制文件是一个免费的account.
./ngrok authtoken [[your_token]] ( https://dashboard.ngrok.com/get-started/setup上的当前页面将包含令牌),这样您就可以将其复制并粘贴到console).
./ngrok http 5001
Forwarding https://xxxxxxxxx.ngrok.io -> http://localhost:5001
https://xxxxxxxxx.ngrok.io/my-project/us-central1/cloudFunctionNamehttps://stackoverflow.com/questions/61614571
复制相似问题