Giter Site home page Giter Site logo

openfaas-nodejs's Introduction

Develop an NodeJS function with OpenFaaS and Okteto Cloud

Develop an NodeJS function with OpenFaaS and Okteto Cloud

Run your function in Okteto Cloud

  1. Deploy OpenfaaS from the application catalog.

  2. Install the OpenFaaS cli locally:

    curl -sSL https://cli.openfaas.com | sudo sh
    
  3. Log into your OpenFaaS gateway (get the gateway URL from Okteto Cloud)

     echo $PASSWORD | faas login -g $GATEWAY_URL --password-stdin
    
  4. Update stack.yaml so the image name uses your namespace instead of rberrelleza

  5. Login to the Okteto Registry

     docker login registry.cloud.okteto.net
    
  6. Build and launch your image

     faas-cli up 
    
  7. Verify that everything works fine:

     faas-cli invoke hello
    

Develop your function in Okteto Cloud

  1. Go to the hello folder and launch your development environment. okteto.yml is already configured with everything you need to develop your function:

     cd hello
     okteto up
    
  2. To start your function, just call the fwatchdog process in your remote development environment:

     $ fwatchdog
    
  3. Your changes will be automatically synchronized. Just stop and start the watchdog to see them applied.

TODO:

  1. Update okteto.yaml to use nodemon for automatic reload instead of starting and stopping fwatchdog

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.