# app.psgi use strict; use warnings; use Plack::Request; use Plack::App::URLMap; use JSON::Tiny qw(encode_json); my $slash = sub { my $env = shift; my $json = encode_json {nose => 'cuke'}; my $status = 200; my $request = Plack::Request->new($env); my $headers = [ 'Content-Type' => 'application/json', 'Content-Length' => length $json, ]; my $body = [ $json ]; [ $status, $headers, $body ]; }; my $urlmap = Plack::App::URLMap->new; $urlmap->mount( "/" => $slash ); my $app = $urlmap->to_app; __END__