-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.psgi
More file actions
36 lines (32 loc) · 723 Bytes
/
app.psgi
File metadata and controls
36 lines (32 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use strict;
use warnings;
use utf8;
use Plack::Request;
use Plack::Builder;
return builder {
mount '/foo' => sub {
my $env = shift;
my $req = Plack::Request->new($env);
my $meth = $req->method;
if ($meth eq 'POST') {
return [
200,
['Content-Type', 'application/octet-stream'],
[$req->content],
]
}
return [
405,
['Content-Type', 'text/plain'],
['Method Not Allowed'],
]
};
mount '/' => sub {
my $env = shift;
return [
200,
['Content-Type', 'text/plain'],
[Dumper($env)],
]
};
};