38 lines
607 B
Perl
38 lines
607 B
Perl
package PoorBooru;
|
|
use Dancer2;
|
|
use HTTP::Tiny;
|
|
|
|
our $VERSION = v0.1;
|
|
|
|
my $POORBOORU_API = setting("poorbooru_api");
|
|
|
|
hook before_template_render => sub {
|
|
my $tokens = shift;
|
|
|
|
$tokens->{uris}->{root} = uri_for("/");
|
|
$tokens->{uris}->{login} = uri_for("/login");
|
|
$tokens->{uris}->{logout} = uri_for("/logout");
|
|
$tokens->{uris}->{random} = uri_for("/random");
|
|
$tokens->{uris}->{tags} = uri_for("/tags");
|
|
};
|
|
|
|
get "/" => sub {
|
|
template "index" => {
|
|
"title" => "main",
|
|
};
|
|
};
|
|
|
|
get "/tags" => sub {
|
|
};
|
|
|
|
get "/tag/:tag_id" => sub {
|
|
};
|
|
|
|
get "/random" => sub {
|
|
};
|
|
|
|
get "/image/:image_id" => sub {
|
|
};
|
|
|
|
true;
|