exports.helloWorld = functions.onRequest((request, response) => { response.send("Hello from Firebase!"); });
特别是,我无法在本地访问路由,并且保存时不会重新加载代码:
我试过了 firebase serve
firebase serve
firebase functions:shell 导致在路由上返回错误:
firebase functions:shell
“/helloWorld不是可识别的路径。”
我可以从照片上看到这一点 firebase > 我可以运行函数,但我正在尝试使用graphql,所以我想使用graphiql web界面
firebase >
当我改变事情时,这两种方法似乎都不能重新加载代码。ctrl+c,向上箭头,enter是当前我的开发环境。
我肯定错过了一些东西,但是 https://firebase.google.com/docs/functions/local-emulator 这很难理解。我错过了什么?
如果你一切都做对了, firebase serve 将为您提供要模拟的HTTP函数的url。它将包含项目的名称、云区域的名称和函数的名称。大概是这样的:
http://localhost:5000/YOUR-PROJECT/YOUR-REGION/helloWorld
,则不会模拟任何函数。你在这里提供的东西无法说明为什么会发生这种情况。也许您没有修改正确的index.js。或者你只是忘了保存文件。或者可能您在错误的项目位置运行firebase Service。无论如何,如果您仍然有问题,您需要提供 准确的