0

I followed the instructions and got the hello world route working online, but I cannot see how to get to a place where I can develop, i.e. to iterate locally. This is my code so far

exports.helloWorld = functions.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});

In particular I cannot access routes locally, and there is no reloading of code on save:

I tried firebase serve and then trying to reach localhost:5000/helloWorld but nothing happened at all.

firebase functions:shell led to an error being returned on the route:

"/helloWorld is not a recognized path."

I can see that from the firebase > I can run functions, but I'm trying to work with graphql so I wanted to use the graphiql web interface

And neither approach seemed to reload code when I changed things. ctrl+c, up-arrow, enter is currently my dev environment.

I'm surely missing stuff but https://firebase.google.com/docs/functions/local-emulator is difficult to follow. What am I missing?

Simon H
  • 20,332
  • 14
  • 71
  • 128

1 Answers1

0

If you've done everything correctly, firebase serve will give you the url of the HTTP function you're trying to emulate. It will contain the name of your project, the name of the Cloud region, and the name of the function. Something like this:

http://localhost:5000/YOUR-PROJECT/YOUR-REGION/helloWorld

If you don't see this URL in the output of firebase serve, then no functions are being emulated. Why that's happening is impossible to say with what you've provided here. Perhaps you're not modifying the correct index.js. Or you just forgot to save the file. Or perhaps you're running firebase serve from the wrong project location. In any event, if you're still having problems, you'll need to provide the exact steps you're taking from the moment of project creation that reproduces the problem.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441