Skip to content

ganesshkumar/openfaas-template-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

openfass-template-java

Supports fast fork

Prerequisite

Usage

Pull template and create a new function

$ faas-cli template pull https://github.com/ganesshkumar/openfaas-template-java

$ faa-cli new --lang java8-gradle java-function

Build and deploy to OpenFaaS

$ faas-cli build -f java-function.yml

$ faas-cli deploy -f java-function.yml

Test your function

$ echo test | faas-cli invoke java-function
You said: openfaas

Updating the function

  • Once you execute faas-cli new command, a new folder is created for your function.
  • This folder is nothing but a gradle project with a rudimentary build.gradle file.
  • There must be a class function.Hander with a method function(String requesBody, String httpMethod) which is the starting point of your function.

Current limitation

  • The template looks for function.Handler class which has a method called function
package function;

public class Handler {
    public String function(String input, String method) {
        return "You said: " + input;
    }
}

Note: These willbe addressed in a better way

About

Java template for openfaas

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages