AWS-Lambda-Quick
view release on metacpan or search on metacpan
#!/usr/bin/perl
use strict;
use warnings;
use FindBin;
use Path::Tiny qw(path);
use lib path( $FindBin::Bin, 'lib' )->stringify;
use Test2::V0;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use AWS::Lambda::Quick::CreateZip ();
use TestHelper::CreateTestFiles qw(populated_tempdir);
my $tempdir = populated_tempdir();
my $zip_filename = path( $tempdir, 'handler.zip' );
my $z = Archive::Zip->new();
ok( $z->read( $zip_filename->stringify ) == AZ_OK, 'read zip okay' );
is( $z->contents('handler.pl'), <<'PERL', 'hander.pl was stored ok' );
BEGIN{$INC{'AWS/Lambda/Quick.pm'}=1} use AWS::Lambda::Quick (
name => 'whatever',
extra_files => 'lib',
);
use lib qw(lib);
use Greeting;
use JSON::PP qw( encode_json );
sub handler {
my $data = shift;
return {
statusCode => 200,
headers => {
'Content-Type' => 'text/plain',
t/03process.t view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use FindBin;
use Path::Tiny qw(path);
use lib path( $FindBin::Bin, 'lib' )->stringify;
use Test2::V0;
use HTTP::Tiny ();
use AWS::Lambda::Quick::Processor ();
use TestHelper::CreateTestFiles qw(populated_tempdir);
ok( 1, 'processor compiled' );
t/lib/TestHelper/CreateTestFiles.pm view on Meta::CPAN
my $dir = path( $tempdir, 'src' );
$dir->mkpath;
# the main source file
path( $dir, 'handler.pl' )->spew(<<'PERL');
use AWS::Lambda::Quick (
name => 'whatever',
extra_files => 'lib',
);
use lib qw(lib);
use Greeting;
use JSON::PP qw( encode_json );
sub handler {
my $data = shift;
return {
statusCode => 200,
headers => {
'Content-Type' => 'text/plain',
( run in 1.361 second using v1.01-cache-2.11-cpan-87723dcf8b7 )