Dev environment for Google Cloud Functions












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?










share|improve this question

























  • Can you point to instructions for helloWorld example?

    – jal_a
    Dec 29 '18 at 10:56
















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?










share|improve this question

























  • Can you point to instructions for helloWorld example?

    – jal_a
    Dec 29 '18 at 10:56














0












0








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?










share|improve this question
















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?







firebase firebase-cli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 29 '18 at 11:37







Simon H

















asked Dec 29 '18 at 10:39









Simon HSimon H

12.7k74477




12.7k74477













  • Can you point to instructions for helloWorld example?

    – jal_a
    Dec 29 '18 at 10:56



















  • Can you point to instructions for helloWorld example?

    – jal_a
    Dec 29 '18 at 10:56

















Can you point to instructions for helloWorld example?

– jal_a
Dec 29 '18 at 10:56





Can you point to instructions for helloWorld example?

– jal_a
Dec 29 '18 at 10:56












1 Answer
1






active

oldest

votes


















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.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53968767%2fdev-environment-for-google-cloud-functions%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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.






    share|improve this answer






























      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.






      share|improve this answer




























        0












        0








        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.






        share|improve this answer















        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 29 '18 at 23:32

























        answered Dec 29 '18 at 19:24









        Doug StevensonDoug Stevenson

        73.4k984105




        73.4k984105






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53968767%2fdev-environment-for-google-cloud-functions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas