Mar*_*arc 5 firebase telegram-bot google-cloud-functions telegram-webhook firebase-cli
会有人知道,如果有一种方法来初始化一个火力地堡功能(使用仿真器来调试本地)与HTTP小号地址,而不是默认的HTTP?我正在尝试调试与 Telegram bot 相关的脚本,而 Telegram 只允许 http的webhook。
外壳输出如下:
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.
Run Code Online (Sandbox Code Playgroud)
我需要它从 http s ://localhost:8443/ 开始。
非常感谢您提前!
就像@bermick 在评论中提到的那样,ngrok是解决这个问题的好方法,直到 Firebase 人员为我们提供了一种在本地模拟器上启用 https 的方法。步骤如下:
./ngrok authtoken [[your_token]]
的当前页面将包含包括令牌的整个命令,因此您只需复制并将其粘贴到控制台中)。./ngrok http 5001
Forwarding https://xxxxxxxxx.ngrok.io -> http://localhost:5001
https://xxxxxxxxx.ngrok.io/my-project/us-central1/cloudFunctionName
归档时间: |
|
查看次数: |
611 次 |
最近记录: |