This commit is contained in:
Difrex 2015-08-11 09:49:27 +03:00
parent 173f74cec6
commit 95357d5c63

View File

@ -19,6 +19,7 @@ use warnings;
use Plack::Builder; use Plack::Builder;
use Plack::Request; use Plack::Request;
use Plack::Response; use Plack::Response;
# Static files # Static files
use Plack::App::File; use Plack::App::File;
@ -65,7 +66,7 @@ my $thread = sub {
my $get = sub { my $get = sub {
$config = $c->reload(); $config = $c->reload();
my $GET = II::Get->new($config); my $GET = II::Get->new($config);
my $msgs = $GET->get_echo(); my $msgs = $GET->get_echo();
my $new_mes = $render->new_mes($msgs); my $new_mes = $render->new_mes($msgs);
return [ 200, [ 'Content-type' => 'text/html' ], ["$new_mes"], ]; return [ 200, [ 'Content-type' => 'text/html' ], ["$new_mes"], ];
@ -178,17 +179,17 @@ my $user = sub {
# Mountpoints # Mountpoints
builder { builder {
mount "/static" => Plack::App::File->new(root => './s/')->to_app; mount "/static" => Plack::App::File->new( root => './s/' )->to_app;
mount '/' => $root; mount '/' => $root;
mount '/e' => $echo; mount '/e' => $echo;
mount '/s' => $thread; mount '/s' => $thread;
mount '/u' => $user; mount '/u' => $user;
mount '/me' => $me; mount '/me' => $me;
mount '/tree' => $tree; mount '/tree' => $tree;
mount '/get/' => $get; mount '/get/' => $get;
mount '/send' => $send; mount '/send' => $send;
mount '/enc' => $enc; mount '/enc' => $enc;
mount '/out' => $out; mount '/out' => $out;
mount '/push' => $push; mount '/push' => $push;
mount '/new' => $new; mount '/new' => $new;
}; };