view release on metacpan or search on metacpan
},
"develop" : {
"requires" : {
"CPAN::Uploader" : "0",
"Capture::Tiny" : "0",
"Dancer2" : "0",
"Minilla" : "0",
"Mojolicious" : "0",
"Parallel::ForkManager" : "0",
"Software::License::MIT" : "0",
"Test::CPAN::Meta" : "0",
"Test::MinimumVersion::Fast" : "0.04",
"Test::PAUSE::Permissions" : "0.07",
"Test::Pod" : "1.41",
"Test::Spellunker" : "v0.2.7",
"Version::Next" : "0"
}
},
"runtime" : {
"recommends" : {
"AWS::XRay" : "0.09"
},
"requires" : {
"HTTP::Tiny" : "0.076",
"JSON::Types" : "0.05",
[![Actions Status](https://github.com/shogo82148/p5-aws-lambda/workflows/Test/badge.svg)](https://github.com/shogo82148/p5-aws-lambda/actions)
# NAME
AWS::Lambda - Perl support for AWS Lambda Custom Runtime.
# SYNOPSIS
Save the following Perl script as `handler.pl`.
sub handle {
my ($payload, $context) = @_;
requires 'Try::Tiny', '0.30';
requires 'Plack', '1.0047';
requires 'Plack::Middleware::ReverseProxy', '0.16';
requires 'JSON::Types', '0.05';
requires 'URI::Escape';
requires 'MIME::Base64';
recommends 'AWS::XRay', '>=0.09';
on 'test' => sub {
requires 'Test::More', '0.98';
requires 'Test::Deep', '1.128';
requires 'Test::TCP', '2.19';
requires 'Test::SharedFork';
requires 'Test::Warn';
requires 'File::Slurp', '9999.25';
requires 'Starman';
};
on 'develop' => sub {
requires 'Minilla';
requires 'Version::Next';
requires 'CPAN::Uploader';
requires 'Software::License::MIT';
requires 'Test::CPAN::Meta';
requires 'Test::Pod';
requires 'Test::MinimumVersion::Fast';
requires 'Mojolicious';
requires 'Dancer2';
requires 'Parallel::ForkManager';
requires 'Capture::Tiny';
};
examples/cgi/WwwCounter/wwwcount.cgi view on Meta::CPAN
#
# CGIã使ç¨ã§ããããã¹ããè¡ãã
#
sub test {
print "Content-type: text/html\n";
print "\n";
print "<!doctype html>\n";
print "<html>\n";
print "<head>\n";
print "<meta charset='utf-8'>\n";
print "<title>Test</title>\n";
print "</head>\n";
print "<body>\n";
print "<p>OK. CGIã¹ã¯ãªããã¯æ£å¸¸ã«åãã¦ãã¾ãã</p>\n";
if ($g_mailto ne "") {
if (! -f $g_sendmail) {
print "<p>ERROR: $g_sendmail ãåå¨ãã¾ããã</p>\n";
}
}
if (!-d $g_lock_dir) {
print "<p>ERROR: $g_lock_dir ãã©ã«ããããã¾ããã</p>\n";
name = "AWS-Lambda"
badges = ["github-actions/Test"]
module_maker="ModuleBuildTiny"
static_install = "auto"
license="mit"
t/00_compile.t view on Meta::CPAN
use strict;
use Test::More 0.98;
use_ok $_ for qw(
AWS::Lambda
AWS::Lambda::AL
AWS::Lambda::AL2
AWS::Lambda::AL2023
AWS::Lambda::Bootstrap
AWS::Lambda::Context
AWS::Lambda::PSGI
);
t/01_echo.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Deep;
use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
my $payload = +{
key1 => 1,
key2 => 2,
key3 => 3,
t/02_error.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
my $error;
my $bootstrap = BootstrapMock->new(
handler => "error.handle",
runtime_api => "example.com",
task_root => "$FindBin::Bin/test_handlers",
t/03_init_error.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
use Try::Tiny;
my $error;
my $bootstrap = BootstrapMock->new(
handler => "init_error.handle",
t/04_handler_not_found.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
use Try::Tiny;
my $error;
my $bootstrap = BootstrapMock->new(
handler => "echo.handle_not_found",
t/10_lambda_next.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use Test::Deep;
my $app_server = Test::TCP->new(
listen => 1,
code => sub {
my $sock = shift;
my $server = HTTP::Server::PSGI->new(
listen_sock => $sock,
);
$server->run(sub {
[
200,
[
t/11_lambda_response.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;
my $app_server = Test::TCP->new(
listen => 1,
code => sub {
my $sock = shift;
my $server = HTTP::Server::PSGI->new(
listen_sock => $sock,
);
$server->run(sub {
my $env = shift;
my $req = Plack::Request->new($env);
is $req->method, "POST", "http method";
t/12_lambda_error.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;
my $app_server = Test::TCP->new(
listen => 1,
code => sub {
my $sock = shift;
my $server = HTTP::Server::PSGI->new(
listen_sock => $sock,
);
$server->run(sub {
my $env = shift;
my $req = Plack::Request->new($env);
is $req->method, "POST", "http method";
t/13_lambda_init_error.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::TCP;
use HTTP::Server::PSGI;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;
my $app_server = Test::TCP->new(
listen => 1,
code => sub {
my $sock = shift;
my $server = HTTP::Server::PSGI->new(
listen_sock => $sock,
);
$server->run(sub {
my $env = shift;
my $req = Plack::Request->new($env);
is $req->method, "POST", "http method";
t/14_streaming.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Deep;
use FindBin;
use lib "$FindBin::Bin/lib";
use BootstrapMock;
use AWS::Lambda::Context;
my $payload = +{
key1 => 1,
key2 => 2,
key3 => 3,
t/15_lambda_response_streaming.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::TCP;
use Starman::Server;
use FindBin;
use AWS::Lambda::Bootstrap;
use AWS::Lambda::Context;
use Test::Deep;
use Test::SharedFork;
use Plack::Request;
use JSON::XS qw/decode_json/;
sub slurp {
my $fh = shift;
my $data = "";
while ($fh->read(my $buf, 4096)) {
$data .= $buf;
}
return $data;
}
my $app_server = Test::TCP->new(
code => sub {
my $port = shift;
my $server = Starman::Server->new;
my $app = sub {
my $env = shift;
my $req = Plack::Request->new($env);
my $headers = $req->headers;
my $body = slurp($req->body);
is $req->method, "POST", "http method is POST";
t/20_psgi.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use FindBin;
use JSON::XS qw/decode_json encode_json/;
use File::Slurp qw(slurp);
use Plack::Request;
use Test::Deep qw(cmp_deeply);
use Test::Warn;
use JSON::Types;
use Encode;
use AWS::Lambda::Context;
use AWS::Lambda::PSGI;
sub slurp_json {
my $name = $_[0];
return decode_json(slurp("$FindBin::Bin/$name"));
}
t/21_psgi_response_streaming.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use FindBin;
use JSON::XS qw/decode_json encode_json/;
use File::Slurp qw(slurp);
use Plack::Request;
use Test::Deep qw(cmp_deeply);
use Test::Warn;
use JSON::Types;
use Encode;
use AWS::Lambda::Context;
use AWS::Lambda::PSGI;
sub slurp_json {
my $name = $_[0];
return decode_json(slurp("$FindBin::Bin/$name"));
}
xt/21_mojo.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use JSON::XS qw/decode_json/;
use AWS::Lambda::PSGI;
use Mojo::Server::PSGI;
my $get_request_for_get_link = <<EOF;
{
"resource": "/{proxy+}",
"path": "/get-link",
"httpMethod": "GET",
xt/21_mojo_custom_domain.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use JSON::XS qw/decode_json/;
use AWS::Lambda::PSGI;
use Mojo::Server::PSGI;
my $get_request_for_get_link = <<EOF;
{
"resource": "/{proxy+}",
"path": "/get-link",
"httpMethod": "GET",
xt/22_dancer.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use JSON::XS qw/decode_json/;
use AWS::Lambda::PSGI;
my $get_request_for_get_link = <<EOF;
{
"resource": "/{proxy+}",
"path": "/get-link",
"httpMethod": "GET",
"headers": {
view all matches for this distributionview release on metacpan - search on metacpan