Skip to content

tmiklas/openfaas-perl-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Perl templates for OpenFaaS

This repository contains a Perl language template for OpenFaaS. If you wish to make suggestions or improvements, please propose them with an issue in this repository.

Trying the template(s)

Alpine

faas template pull https://github.com/tmiklas/openfaas-perl-templates
faas new --lang perl-alpine hello-perl

This will generate:

hello-perl.yml
hello-perl/FaaSHandler.pm
hello-perl/cpanfile

The code shipped with template does not require any Perl modules - ready to test as-is.

To install any modules your function requires, please add them to the cpanfile - they will be installed using cpanm directly from CPAN.

Below is a sample cpanfile (see docs for details and more advanced options):

requires 'LWP::Protocl::https';
requires 'WWW::Mechanize';
requires 'common::sense';

You can implement your handler within FaaSHandler.pm:

package FaaSHandler;
use strict;
use warnings;

sub handle {
    my $st = shift;
    return "Hello $st !";
}

1;

Finally, when ready run faas-cli up -f hello-perl.

About

Perl templates for OpenFaaS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published