AWS-Lambda

 view release on metacpan or  search on metacpan

examples/cgi/WwwCounter/readme.html  view on Meta::CPAN

変更後:<img src="wwwcount.cgi?hide+neko.gif" 略...>
</pre>
<p>隠しカウンタのカウント数は、レポート機能や、wwwcount.cnt ファイルを直接参照することで確認できます。</p>
</div>

<h4>■ <a name="RefFind">リンク元発見機能</a></h4>
<div class=i>
<p>CGIグラフィックカウンターを以下のように呼び出すと、自分のホームページがどこからリンクされているのか発見することができます。</p>
<pre class=c>
&lt;script&gt;
xx = escape(document.referrer);
yy = "";
for (i = 0; i &lt; xx.length; i++) {
  zz = xx.charAt(i);
  yy += (zz == "+") ? "%2B" : zz;
}
document.write('&lt;img width=96 height=19 ');
document.write('src="wwwcount.cgi?gif');
document.write('+ref+', yy, '"&gt;');
&lt;/script&gt;
&lt;noscript&gt;

examples/s3-get-object/handler.pl  view on Meta::CPAN

use Paws;
use Try::Tiny;
use URI::Escape;

my $obj = Paws->service('S3', region => 'ap-northeast-1');

sub handle {
    my $payload = shift;
    # Get the object from the event and show its content type
    my $bucket = $payload->{Records}[0]{s3}{bucket}{name};
    my $key = uri_unescape($payload->{Records}[0]{s3}{object}{key} =~ s/\+/ /gr);
    my $resp = try {
        $obj->GetObject(
            Bucket => $bucket,
            Key    => $key,
        );
    } catch {
        print STDERR "$_\n";
        my $message = "Error getting object $key from bucket $bucket. Make sure they exist and your bucket is in the same region as this function.";
        print STDERR "$message\n";
        die $message;

lib/AWS/Lambda/PSGI.pm  view on Meta::CPAN

        $body = decode_base64 $body;
    }
    open my $input, "<", \$body;
    $env->{REQUEST_METHOD} = $payload->{httpMethod};
    $env->{'psgi.input'} = $input;
    $env->{CONTENT_LENGTH} //= bytes::length($body);
    $env->{REQUEST_URI} = $payload->{path};
    if ($env->{QUERY_STRING}) {
        $env->{REQUEST_URI} .= '?' . $env->{QUERY_STRING};
    }
    $env->{PATH_INFO} = URI::Escape::uri_unescape($payload->{path});

    $env->{SCRIPT_NAME} = '';
    my $requestContext = $payload->{requestContext};
    if ($requestContext) {
        my $path = $requestContext->{path};
        my $stage = $requestContext->{stage};
        if ($stage && $path && $path ne $payload->{path}) {
            $env->{SCRIPT_NAME} = "/$stage";
        }
    }



( run in 1.065 second using v1.01-cache-2.11-cpan-c21f80fb71c )