PoorBooru/lib/PoorBooru.pm

27 lines
422 B
Perl
Raw Normal View History

2023-03-04 22:58:18 +01:00
package PoorBooru;
use v5.36;
use strict;
use warnings;
use Mojo::Base "Mojolicious";
2023-03-05 18:23:13 +01:00
use SeaweedFS::Client;
2023-03-04 22:58:18 +01:00
sub startup ($self)
{
$self->moniker("poorbooru");
my $config = $self->plugin("Config");
$self->secrets($config->{secrets});
2023-03-05 18:23:13 +01:00
$self->helper(seaweed => sub {
state $client =
SeaweedFS::Client->new($config->{seaweedfs_master})
2023-03-04 22:58:18 +01:00
});
2023-03-05 18:23:13 +01:00
my $r = $self->routes;
$r->get("/")->to("gallery#index");
2023-03-04 22:58:18 +01:00
}
1;